Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -147,14 +147,19 @@ def retrieve_document(query):
|
|
147 |
|
148 |
print(filename)
|
149 |
|
150 |
-
|
151 |
|
152 |
-
print(
|
153 |
|
154 |
-
|
155 |
-
|
156 |
-
|
|
|
|
|
|
|
157 |
|
|
|
|
|
158 |
def clean_text(text):
|
159 |
"""Cleans extracted text for better processing by the model."""
|
160 |
print("cleaning")
|
|
|
147 |
|
148 |
print(filename)
|
149 |
|
150 |
+
response = requests.get(API_URL_FILES, params={"file":filename})
|
151 |
|
152 |
+
print(response)
|
153 |
|
154 |
+
if response.status_code == 200:
|
155 |
+
with open(filename, "wb") as f:
|
156 |
+
f.write(response.content)
|
157 |
+
print(f"File downloaded successfully: {filename}")
|
158 |
+
else:
|
159 |
+
print(f"Error: {response.status_code}, {response.json()}")
|
160 |
|
161 |
+
return filename
|
162 |
+
|
163 |
def clean_text(text):
|
164 |
"""Cleans extracted text for better processing by the model."""
|
165 |
print("cleaning")
|