pvduy commited on
Commit
e2b5fc2
1 Parent(s): 87aa391

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,5 +1,7 @@
1
  import argparse
2
  import os
 
 
3
 
4
  #hack install gradio
5
  os.system("pip uninstall -y gradio")
@@ -21,6 +23,7 @@ def parse_args():
21
  parser.add_argument("--n_gpus", type=int, default=1) # n_gpu
22
  return parser.parse_args()
23
 
 
24
  def predict(message, history, system_prompt, temperature, max_tokens):
25
  global model, tokenizer, device
26
  instruction = "<|im_start|>system\nA chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n<|im_end|>\n"
 
1
  import argparse
2
  import os
3
+ import spaces
4
+
5
 
6
  #hack install gradio
7
  os.system("pip uninstall -y gradio")
 
23
  parser.add_argument("--n_gpus", type=int, default=1) # n_gpu
24
  return parser.parse_args()
25
 
26
+ @spaces.GPU()
27
  def predict(message, history, system_prompt, temperature, max_tokens):
28
  global model, tokenizer, device
29
  instruction = "<|im_start|>system\nA chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.\n<|im_end|>\n"