IEIT-Yuan commited on
Commit
28f4c11
ยท
verified ยท
1 Parent(s): b1e52c0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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("cuda:0")
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.