ehristoforu commited on
Commit
4b22725
·
verified ·
1 Parent(s): 9dffb16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -52,7 +52,7 @@ api.upload_folder(
52
  )
53
  '''
54
 
55
- @spaces.GPU(duration=60)
56
  def generate(
57
  message: str,
58
  chat_history: list[dict],
@@ -68,7 +68,7 @@ def generate(
68
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
69
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
70
  gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
71
- input_ids = input_ids.to(model.device)
72
 
73
  streamer = TextIteratorStreamer(tokenizer, timeout=20.0, skip_prompt=True, skip_special_tokens=True)
74
  generate_kwargs = dict(
 
52
  )
53
  '''
54
 
55
+ @spaces.GPU()
56
  def generate(
57
  message: str,
58
  chat_history: list[dict],
 
68
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
69
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
70
  gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
71
+ input_ids = input_ids.to(merged_model.device)
72
 
73
  streamer = TextIteratorStreamer(tokenizer, timeout=20.0, skip_prompt=True, skip_special_tokens=True)
74
  generate_kwargs = dict(