Skip to content

Commit

Permalink
fix requirements and download mode
Browse files Browse the repository at this point in the history
  • Loading branch information
khimaros committed May 7, 2023
1 parent d6294fd commit f085021
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ torch
torchvision
torchaudio
transformers
scipyftfy
scipy
ftfy
accelerate
tensorboard
toml
6 changes: 3 additions & 3 deletions transformable.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,13 @@ def invoke_task(config):
tokenizer = transformers.AutoTokenizer.from_pretrained(tokenizer_path)

if config['kind'] == 'text-generation':
model = transformers.AutoModelForCausalLM.from_pretrained(model_path, local_files_only=True)
model = transformers.AutoModelForCausalLM.from_pretrained(model_path, local_files_only=local_files_only)

elif config['kind'] == 'question-answering':
model = transformers.AutoModelForQuestionAnswering.from_pretrained(model_path, local_files_only=True)
model = transformers.AutoModelForQuestionAnswering.from_pretrained(model_path, local_files_only=local_files_only)

elif config['kind'] == 'conversational':
model = transformers.AutoModelForSeq2SeqLM.from_pretrained(model_path, local_files_only=True)
model = transformers.AutoModelForSeq2SeqLM.from_pretrained(model_path, local_files_only=local_files_only)

pipe = transformers.pipeline(config['kind'], model=model, tokenizer=tokenizer)

Expand Down

0 comments on commit f085021

Please sign in to comment.