joaogante HF staff commited on
Commit
ef976dc
·
verified ·
1 Parent(s): e08f7f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -21,7 +21,7 @@ def run_generation(user_text, use_assistant, temperature, max_new_tokens):
21
  do_sample = True
22
 
23
  # Get the model and tokenizer, and tokenize the user text.
24
- model_inputs = tokenizer([user_text], return_tensors="pt").to(torch_device)
25
 
26
  # Start generation on a separate thread, so that we don't block the UI. The text is pulled from the streamer
27
  # in the main thread. Adds timeout to the streamer to handle exceptions in the generation thread.
 
21
  do_sample = True
22
 
23
  # Get the model and tokenizer, and tokenize the user text.
24
+ model_inputs = tokenizer([user_text], return_tensors="pt").to(model.device)
25
 
26
  # Start generation on a separate thread, so that we don't block the UI. The text is pulled from the streamer
27
  # in the main thread. Adds timeout to the streamer to handle exceptions in the generation thread.