Spaces:
Running
Running
Allen Park
commited on
Commit
Β·
120b840
1
Parent(s):
0bcc960
remove print statements
Browse files
app.py
CHANGED
@@ -214,17 +214,14 @@ def model_call(question, document, answer, client_base_url):
|
|
214 |
base_url=client_base_url,
|
215 |
api_key=LEPTON_API_TOKEN
|
216 |
)
|
217 |
-
print("CLIENT AND CLIENT BASE URL", client, client_base_url)
|
218 |
if question == "" or document == "" or answer == "":
|
219 |
return "", ""
|
220 |
NEW_FORMAT = PROMPT.format(question=question, document=document, answer=answer)
|
221 |
-
print("ENTIRE NEW_FORMAT", NEW_FORMAT)
|
222 |
response = client.completions.create(
|
223 |
model="gpt-3.5-turbo-instruct",
|
224 |
prompt=NEW_FORMAT,
|
225 |
temperature=0.0
|
226 |
)
|
227 |
-
print("RESPONSE FROM CLIENT:", response)
|
228 |
hallucination, reasoning = parse_patronus_lynx_response(response.choices[0].text)
|
229 |
score = "π΄ FAIL π΄" if hallucination else "π’ PASS π’"
|
230 |
combined_reasoning = " ".join(reasoning)[1:-1]
|
@@ -257,8 +254,6 @@ def upload_file(filepath):
|
|
257 |
extracted_file_text = ""
|
258 |
if filepath is not None:
|
259 |
name = Path(filepath).name
|
260 |
-
print("FILEPATH & file name", filepath, name)
|
261 |
-
print("FILEPATH type & file name type", type(filepath), type(name))
|
262 |
filetype = get_filetype(name)
|
263 |
# conditionals for filetype and function call
|
264 |
if filetype == "pdf" or filetype == "txt":
|
|
|
214 |
base_url=client_base_url,
|
215 |
api_key=LEPTON_API_TOKEN
|
216 |
)
|
|
|
217 |
if question == "" or document == "" or answer == "":
|
218 |
return "", ""
|
219 |
NEW_FORMAT = PROMPT.format(question=question, document=document, answer=answer)
|
|
|
220 |
response = client.completions.create(
|
221 |
model="gpt-3.5-turbo-instruct",
|
222 |
prompt=NEW_FORMAT,
|
223 |
temperature=0.0
|
224 |
)
|
|
|
225 |
hallucination, reasoning = parse_patronus_lynx_response(response.choices[0].text)
|
226 |
score = "π΄ FAIL π΄" if hallucination else "π’ PASS π’"
|
227 |
combined_reasoning = " ".join(reasoning)[1:-1]
|
|
|
254 |
extracted_file_text = ""
|
255 |
if filepath is not None:
|
256 |
name = Path(filepath).name
|
|
|
|
|
257 |
filetype = get_filetype(name)
|
258 |
# conditionals for filetype and function call
|
259 |
if filetype == "pdf" or filetype == "txt":
|