Skip to content

Commit b765dce

Browse files
Yushi HommaYushi Homma
authored andcommitted
Added model revision as a settable environment variable for snapshot_download
1 parent e24c26a commit b765dce

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def load_model():
3232
global generator, default_settings
3333

3434
if not generator:
35-
model_directory = snapshot_download(repo_id=os.environ["MODEL_REPO"])
35+
model_directory = snapshot_download(repo_id=os.environ["MODEL_REPO"], revision=os.getenv("MODEL_REVISION", "main"))
3636
tokenizer_path = os.path.join(model_directory, "tokenizer.model")
3737
model_config_path = os.path.join(model_directory, "config.json")
3838
st_pattern = os.path.join(model_directory, "*.safetensors")

predict.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def stream_output(task_id, stream=False):
5454
sys.stdout.write(new_output[len(previous_output):])
5555
sys.stdout.flush()
5656
previous_output = new_output
57-
elif len(data['stream']) > 0:
5857
return data['stream'][0]['output']
5958

6059
if data.get('status') == 'COMPLETED':

0 commit comments

Comments
 (0)