pvduy commited on
Commit
31a1ff8
1 Parent(s): 9ab71e4

fix zero-gpu

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,6 +1,6 @@
1
  import argparse
2
  import os
3
- #import spaces
4
 
5
 
6
  import gradio as gr
@@ -20,7 +20,7 @@ def parse_args():
20
  parser.add_argument("--n_gpus", type=int, default=1) # n_gpu
21
  return parser.parse_args()
22
 
23
- #@spaces.GPU()
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
  import gradio as gr
 
20
  parser.add_argument("--n_gpus", type=int, default=1) # n_gpu
21
  return parser.parse_args()
22
 
23
+ @spaces.GPU()
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"