Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,10 @@ def askme(symptoms, question):
|
|
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)[0].strip()
|
34 |
-
|
|
|
|
|
|
|
35 |
|
36 |
# Example usage
|
37 |
symptoms = '''\
|
|
|
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)[0].strip()
|
34 |
+
# Remove system messages and content
|
35 |
+
response_text = response_text.replace(sys_message, "").replace(content, "").strip()
|
36 |
+
|
37 |
+
return response_text
|
38 |
|
39 |
# Example usage
|
40 |
symptoms = '''\
|