Skip to content

Commit

Permalink
Added model revision as a settable environment variable for snapshot_…
Browse files Browse the repository at this point in the history
…download
  • Loading branch information
Yushi Homma authored and Yushi Homma committed Jul 25, 2023
1 parent e24c26a commit b765dce
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def load_model():
global generator, default_settings

if not generator:
model_directory = snapshot_download(repo_id=os.environ["MODEL_REPO"])
model_directory = snapshot_download(repo_id=os.environ["MODEL_REPO"], revision=os.getenv("MODEL_REVISION", "main"))
tokenizer_path = os.path.join(model_directory, "tokenizer.model")
model_config_path = os.path.join(model_directory, "config.json")
st_pattern = os.path.join(model_directory, "*.safetensors")
Expand Down
1 change: 0 additions & 1 deletion predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def stream_output(task_id, stream=False):
sys.stdout.write(new_output[len(previous_output):])
sys.stdout.flush()
previous_output = new_output
elif len(data['stream']) > 0:
return data['stream'][0]['output']

if data.get('status') == 'COMPLETED':
Expand Down

0 comments on commit b765dce

Please sign in to comment.