Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,7 @@ def extract_text(file):
|
|
| 28 |
# ---- API embedding helper ----
|
| 29 |
def get_embedding(text):
|
| 30 |
payload = {"inputs": text}
|
| 31 |
-
resp = requests.post(API_URL, headers=
|
| 32 |
data = resp.json()
|
| 33 |
if isinstance(data, list) and "embedding" in data[0]:
|
| 34 |
return np.array(data[0]["embedding"])
|
|
|
|
| 28 |
# ---- API embedding helper ----
|
| 29 |
def get_embedding(text):
|
| 30 |
payload = {"inputs": text}
|
| 31 |
+
resp = requests.post(API_URL, headers=headers, json=payload, timeout=60)
|
| 32 |
data = resp.json()
|
| 33 |
if isinstance(data, list) and "embedding" in data[0]:
|
| 34 |
return np.array(data[0]["embedding"])
|