hf-lin commited on
Commit
fc9a57c
1 Parent(s): eac8ee9

update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -186,7 +186,7 @@ def _launch_demo(model, tokenizer):
186
  )
187
 
188
  gr.Markdown("""\
189
- <center><font size=4>Chat-Musician <a href="https://huggingface.co/m-a-p/ChatMusician-v1-sft-78k">🤗</a>&nbsp |
190
  &nbsp<a href="https://github.com/a43992899/Chat-Musician">Github</a></center>""")
191
  gr.Markdown("""\
192
  <center><font size=4>💡Note: The music clips on this page is auto-converted from abc notations which may not be perfect,
@@ -281,16 +281,17 @@ def _launch_demo(model, tokenizer):
281
 
282
 
283
  tokenizer = AutoTokenizer.from_pretrained(
284
- MODEL_PATH, trust_remote_code=True, resume_download=True,
285
  )
286
 
287
  model = AutoModelForCausalLM.from_pretrained(
288
  MODEL_PATH,
289
- device_map='cuda'
 
290
  ).eval()
291
 
292
  model.generation_config = GenerationConfig.from_pretrained(
293
- MODEL_PATH, trust_remote_code=True, resume_download=True,
294
  )
295
 
296
  app = _launch_demo(model, tokenizer)
 
186
  )
187
 
188
  gr.Markdown("""\
189
+ <center><font size=4>ChatMusician <a href="https://huggingface.co/m-a-p/ChatMusician-v1-sft-78k">🤗</a>&nbsp |
190
  &nbsp<a href="https://github.com/a43992899/Chat-Musician">Github</a></center>""")
191
  gr.Markdown("""\
192
  <center><font size=4>💡Note: The music clips on this page is auto-converted from abc notations which may not be perfect,
 
281
 
282
 
283
  tokenizer = AutoTokenizer.from_pretrained(
284
+ MODEL_PATH
285
  )
286
 
287
  model = AutoModelForCausalLM.from_pretrained(
288
  MODEL_PATH,
289
+ device_map='cuda',
290
+ torch_dtype=torch.float16
291
  ).eval()
292
 
293
  model.generation_config = GenerationConfig.from_pretrained(
294
+ MODEL_PATH
295
  )
296
 
297
  app = _launch_demo(model, tokenizer)