[Refactor] Relative imports wherever we can (#21880)

* initial commit

* update

* second batch

* style

* fix imports

* fix relative import on pipeline
This commit is contained in:
Arthur
2023-03-02 09:45:42 +01:00
committed by GitHub
parent 43299c63ca
commit 633e5e89f7
77 changed files with 145 additions and 249 deletions

View File

@@ -2,7 +2,7 @@ import numpy as np
import torch
from torch.utils.data import Dataset, IterableDataset
from transformers.utils.generic import ModelOutput
from ..utils.generic import ModelOutput
class PipelineDataset(Dataset):

View File

@@ -1,8 +1,7 @@
import enum
import warnings
from transformers import MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_CAUSAL_LM_MAPPING
from .. import MODEL_FOR_CAUSAL_LM_MAPPING, TF_MODEL_FOR_CAUSAL_LM_MAPPING
from ..utils import add_end_docstrings, is_tf_available
from .base import PIPELINE_INIT_ARGS, Pipeline