Spaces:
Runtime error
Runtime error
update app.py
Browse files
app.py
CHANGED
|
@@ -186,7 +186,7 @@ def _launch_demo(model, tokenizer):
|
|
| 186 |
)
|
| 187 |
|
| 188 |
gr.Markdown("""\
|
| 189 |
-
<center><font size=4>
|
| 190 |
 <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
|
| 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
|
| 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>  |
|
| 190 |
 <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)
|