Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,13 +71,9 @@ def store_document_data(PDF_FILE):
|
|
| 71 |
|
| 72 |
doc_index = index.ntotal - 1
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
file_content = f.read(20) # Read first 20 bytes
|
| 78 |
-
print("First 20 bytes of the file:", file_content)
|
| 79 |
-
|
| 80 |
-
response = requests.post(API_URL_EMBEDDINGS, files={"file": f})
|
| 81 |
|
| 82 |
print("sent", response.json())
|
| 83 |
except requests.exceptions.RequestException as e:
|
|
|
|
| 71 |
|
| 72 |
doc_index = index.ntotal - 1
|
| 73 |
|
| 74 |
+
with open(index_file, "rb") as f:
|
| 75 |
+
response = requests.post(API_URL_EMBEDDINGS,
|
| 76 |
+
files={"file": ("index.bin", f, "application/octet-stream")})
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
print("sent", response.json())
|
| 79 |
except requests.exceptions.RequestException as e:
|