ykl7 commited on
Commit
96ebd33
·
1 Parent(s): 6271c29

prompts debug

Browse files
Files changed (2) hide show
  1. app.py +7 -2
  2. prompts.py +1 -1
app.py CHANGED
@@ -6,6 +6,7 @@ import os
6
  from llm_reasoner import LLMReasoner
7
  from prompts import templates
8
  from typing import Any
 
9
 
10
  st.header(" Scientific Claim Verification ")
11
  st.caption("Team UMBC-SBU-UT")
@@ -161,10 +162,14 @@ def reasoner(query: str, documents: list[str], llm_client: Any):
161
  message = "Using o3-mini to quickly analyze the claim..."
162
 
163
  if not documents or len(documents) == 0:
164
- prompt = templates["no_evidence"].format(claim=query)
 
 
165
  else:
166
  # TODO: fix prompt call to include retrieved documents
167
- prompt = templates["no_evidence"].format(claim=query)
 
 
168
 
169
  llm_response = llm_client.run_inference(prompt)
170
 
 
6
  from llm_reasoner import LLMReasoner
7
  from prompts import templates
8
  from typing import Any
9
+ from string import Template
10
 
11
  st.header(" Scientific Claim Verification ")
12
  st.caption("Team UMBC-SBU-UT")
 
162
  message = "Using o3-mini to quickly analyze the claim..."
163
 
164
  if not documents or len(documents) == 0:
165
+ prompt_template = Template(templates["no_evidence"])
166
+ prompt = prompt_template.substitute(claim=query)
167
+ # prompt = templates["no_evidence"].format(claim=query)
168
  else:
169
  # TODO: fix prompt call to include retrieved documents
170
+ prompt_template = Template(templates["no_evidence"])
171
+ prompt = prompt_template.substitute(claim=query)
172
+ # prompt = templates["no_evidence"].format(claim=query)
173
 
174
  llm_response = llm_client.run_inference(prompt)
175
 
prompts.py CHANGED
@@ -1,6 +1,6 @@
1
  templates = {
2
  "no_evidence": "You are an AI model tasked with verifying claims related to medical and health topics using zero-shot learning. Your job is to analyze a given claim and decide whether the available evidence and your general medical knowledge would likely SUPPORT or CONTRADICT the claim." \
3
- "Claim to Evaluate: <claim> {claim} </claim>" \
4
  "Guidelines:" \
5
  "Evaluate the claim's plausibility based on general medical knowledge." \
6
  "Consider the specificity and credibility of any numbers or percentages." \
 
1
  templates = {
2
  "no_evidence": "You are an AI model tasked with verifying claims related to medical and health topics using zero-shot learning. Your job is to analyze a given claim and decide whether the available evidence and your general medical knowledge would likely SUPPORT or CONTRADICT the claim." \
3
+ "Claim to Evaluate: <claim> $claim </claim>" \
4
  "Guidelines:" \
5
  "Evaluate the claim's plausibility based on general medical knowledge." \
6
  "Consider the specificity and credibility of any numbers or percentages." \