Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -92,6 +92,7 @@ def encode_docs(docs,maxlen = 64, stride = 32):
|
|
| 92 |
return embeddings, spans, file_names
|
| 93 |
|
| 94 |
def predict(query,data):
|
|
|
|
| 95 |
name_to_save = data.name.split("/")[-1].split(".")[0][:-8]
|
| 96 |
k=20
|
| 97 |
st = str([query,name_to_save])
|
|
@@ -173,7 +174,7 @@ def predict(query,data):
|
|
| 173 |
df = pd.DataFrame(table)
|
| 174 |
print(df)
|
| 175 |
print("time: "+ str(time.time()-start))
|
| 176 |
-
|
| 177 |
|
| 178 |
with open("HISTORY.txt","a", encoding = "utf-8") as f:
|
| 179 |
f.write(hist)
|
|
@@ -194,9 +195,11 @@ def predict(query,data):
|
|
| 194 |
|
| 195 |
return list_outputs
|
| 196 |
|
|
|
|
|
|
|
| 197 |
iface = gr.Interface(examples = [
|
| 198 |
["How high is the highest mountain?","China.pdf"],
|
| 199 |
-
["Where
|
| 200 |
],
|
| 201 |
|
| 202 |
fn =predict,
|
|
|
|
| 92 |
return embeddings, spans, file_names
|
| 93 |
|
| 94 |
def predict(query,data):
|
| 95 |
+
print(datetime.today().strftime('%Y-%m-%d %H:%M:%S'))
|
| 96 |
name_to_save = data.name.split("/")[-1].split(".")[0][:-8]
|
| 97 |
k=20
|
| 98 |
st = str([query,name_to_save])
|
|
|
|
| 174 |
df = pd.DataFrame(table)
|
| 175 |
print(df)
|
| 176 |
print("time: "+ str(time.time()-start))
|
| 177 |
+
|
| 178 |
|
| 179 |
with open("HISTORY.txt","a", encoding = "utf-8") as f:
|
| 180 |
f.write(hist)
|
|
|
|
| 195 |
|
| 196 |
return list_outputs
|
| 197 |
|
| 198 |
+
|
| 199 |
+
|
| 200 |
iface = gr.Interface(examples = [
|
| 201 |
["How high is the highest mountain?","China.pdf"],
|
| 202 |
+
["Where is the highest mountain?","China.pdf"]
|
| 203 |
],
|
| 204 |
|
| 205 |
fn =predict,
|