Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def predict(message, history):
|
|
58 |
# if '</s>' in partial_message: # Breaking the loop if the stop token is generated.
|
59 |
# break
|
60 |
# yield partial_message
|
61 |
-
inputs = tokenizer(message, return_tensors="pt")["input_ids"].to(
|
62 |
outputs = model.generate(inputs, do_sample=False, max_length=100)
|
63 |
return(tokenizer.decode(outputs[0]))
|
64 |
|
@@ -67,5 +67,5 @@ def predict(message, history):
|
|
67 |
gr.ChatInterface(predict,
|
68 |
title="Yuan2_2b_chatBot",
|
69 |
description="่ฏทๆ้ฎ",
|
70 |
-
examples=['่ฏท้ฎ็ฎๅๆๅ
่ฟ็ๆบๅจๅญฆไน ็ฎๆณๆๅชไบ๏ผ']
|
71 |
).launch() # Launching the web interface.
|
|
|
58 |
# if '</s>' in partial_message: # Breaking the loop if the stop token is generated.
|
59 |
# break
|
60 |
# yield partial_message
|
61 |
+
inputs = tokenizer(message, return_tensors="pt")["input_ids"].to(device)
|
62 |
outputs = model.generate(inputs, do_sample=False, max_length=100)
|
63 |
return(tokenizer.decode(outputs[0]))
|
64 |
|
|
|
67 |
gr.ChatInterface(predict,
|
68 |
title="Yuan2_2b_chatBot",
|
69 |
description="่ฏทๆ้ฎ",
|
70 |
+
examples=['่ฏท้ฎ็ฎๅๆๅ
่ฟ็ๆบๅจๅญฆไน ็ฎๆณๆๅชไบ๏ผ','ไฝไธ้ฆๅ
ณไบๆฅ่็่ฏ','ๅไบฌ็ค้ธญๆไนๅ๏ผ']
|
71 |
).launch() # Launching the web interface.
|