Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,12 +15,10 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 15 |
)
|
| 16 |
model.eval()
|
| 17 |
|
| 18 |
-
SYSTEM_PROMPT = "You are an expert biomedical assistant trained to identify randomized controlled trials (RCTs). Include RCTs and exclude non-RCTs."
|
| 19 |
-
|
| 20 |
@spaces.GPU(duration=120)
|
| 21 |
def stream_response(title_text, abstract_text):
|
| 22 |
user_input = f"Title: {title_text.strip()}\nAbstract: {abstract_text.strip()}"
|
| 23 |
-
prompt = f"
|
| 24 |
|
| 25 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 26 |
inputs.pop("token_type_ids", None)
|
|
|
|
| 15 |
)
|
| 16 |
model.eval()
|
| 17 |
|
|
|
|
|
|
|
| 18 |
@spaces.GPU(duration=120)
|
| 19 |
def stream_response(title_text, abstract_text):
|
| 20 |
user_input = f"Title: {title_text.strip()}\nAbstract: {abstract_text.strip()}"
|
| 21 |
+
prompt = f"\n<|user|>\n{user_input}\n<|assistant|>\n"
|
| 22 |
|
| 23 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 24 |
inputs.pop("token_type_ids", None)
|