Spaces:
Runtime error
Runtime error
Matthias Kleiner
commited on
Commit
·
a5926f8
1
Parent(s):
2504cff
updated dataset creation
Browse files
app.py
CHANGED
@@ -91,7 +91,7 @@ def func(file, number_of_pages, secret):
|
|
91 |
|
92 |
|
93 |
# output, parsed_document = client.predict(file, number_of_pages)
|
94 |
-
output = client.predict(file, number_of_pages)
|
95 |
|
96 |
if "Error" in output:
|
97 |
return output
|
@@ -111,12 +111,15 @@ def func(file, number_of_pages, secret):
|
|
111 |
|
112 |
return output
|
113 |
|
114 |
-
def save_output(unique_filename: str, output: str, num_pages:int, date_string: str) -> None:
|
115 |
|
116 |
# Append outputs and using a thread lock to avoid concurrent writes from different users.
|
117 |
with scheduler.lock:
|
118 |
with feedback_file.open("a") as f:
|
119 |
-
f.write(json.dumps({"input_name": unique_filename, "output": output,
|
|
|
|
|
|
|
120 |
f.write("\n")
|
121 |
|
122 |
|
|
|
91 |
|
92 |
|
93 |
# output, parsed_document = client.predict(file, number_of_pages)
|
94 |
+
output, latex_output, latex_time, openai_time = client.predict(file, number_of_pages)
|
95 |
|
96 |
if "Error" in output:
|
97 |
return output
|
|
|
111 |
|
112 |
return output
|
113 |
|
114 |
+
def save_output(unique_filename: str, output: str, num_pages:int, date_string: str, latex_output: str, latex_time: float, openai_time: float) -> None:
|
115 |
|
116 |
# Append outputs and using a thread lock to avoid concurrent writes from different users.
|
117 |
with scheduler.lock:
|
118 |
with feedback_file.open("a") as f:
|
119 |
+
f.write(json.dumps({"input_name": unique_filename, "output": output,
|
120 |
+
"num_pages": num_pages, "timestamp": date_string,
|
121 |
+
"latex": latex_output, "latex_extraction_time": latex_time,
|
122 |
+
"openai_call_time": openai_time}))
|
123 |
f.write("\n")
|
124 |
|
125 |
|