Commit cbbb3c43 authored by Julien Chaumond's avatar Julien Chaumond
Browse files

[hubconf] Modify pythonpath to get canonical imports to work

See https://github.com/huggingface/transformers/pull/3881/files#r412292660

Should we remove SRC_DIR from sys.path right after the imports, @aaugustin?
parent 77b75d2c
from src.transformers import ( import os
import sys
SRC_DIR = os.path.join(os.path.dirname(__file__), "src")
sys.path.append(SRC_DIR)
from transformers import (
AutoConfig, AutoConfig,
AutoModel, AutoModel,
AutoModelForQuestionAnswering, AutoModelForQuestionAnswering,
AutoModelForSequenceClassification, AutoModelForSequenceClassification,
AutoModelWithLMHead, AutoModelWithLMHead,
AutoTokenizer, AutoTokenizer,
add_start_docstrings,
) )
from src.transformers.file_utils import add_start_docstrings
dependencies = ["torch", "numpy", "tokenizers", "boto3", "filelock", "requests", "tqdm", "regex", "sentencepiece", "sacremoses"] dependencies = ["torch", "numpy", "tokenizers", "boto3", "filelock", "requests", "tqdm", "regex", "sentencepiece", "sacremoses"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment