ruslanmv commited on
Commit
b6f2547
·
verified ·
1 Parent(s): 1529027

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -30,7 +30,7 @@ def askme(symptoms, question):
30
  prompt = tokenizer.apply_chat_template(messages, template=custom_template, tokenize=False, add_generation_prompt=True)
31
  inputs = tokenizer(prompt, return_tensors="pt").to(device) # Ensure inputs are on CUDA device
32
  outputs = model.generate(**inputs, max_new_tokens=200, use_cache=True)
33
- response_text r.batch_decode(outputs, skip_special_tokens=True)[0].strip()
34
 
35
  # Extract only the assistant's response
36
  start_idx = response_text.find("<|im_start|>assistant")
 
30
  prompt = tokenizer.apply_chat_template(messages, template=custom_template, tokenize=False, add_generation_prompt=True)
31
  inputs = tokenizer(prompt, return_tensors="pt").to(device) # Ensure inputs are on CUDA device
32
  outputs = model.generate(**inputs, max_new_tokens=200, use_cache=True)
33
+ response_text = tokenizer.batch_decode(outputs, skip_special_tokens=True)[0].strip()
34
 
35
  # Extract only the assistant's response
36
  start_idx = response_text.find("<|im_start|>assistant")