Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ MAP_TILES = {
|
|
26 |
}
|
27 |
|
28 |
# NuExtract API configuration
|
29 |
-
|
30 |
headers = {"Authorization": f"Bearer {os.environ.get('HF_TOKEN', '')}"}
|
31 |
|
32 |
class SafeGeocoder:
|
@@ -89,7 +89,7 @@ def load_model():
|
|
89 |
}
|
90 |
}
|
91 |
|
92 |
-
response = requests.post(
|
93 |
|
94 |
if response.status_code == 503:
|
95 |
response_json = response.json()
|
@@ -124,7 +124,7 @@ def extract_info(template, text):
|
|
124 |
}
|
125 |
}
|
126 |
|
127 |
-
response = requests.post(
|
128 |
|
129 |
if response.status_code == 503:
|
130 |
response_json = response.json()
|
|
|
26 |
}
|
27 |
|
28 |
# NuExtract API configuration
|
29 |
+
API_URL = "https://api-inference.huggingface.co/models/numind/NuExtract-1.5"
|
30 |
headers = {"Authorization": f"Bearer {os.environ.get('HF_TOKEN', '')}"}
|
31 |
|
32 |
class SafeGeocoder:
|
|
|
89 |
}
|
90 |
}
|
91 |
|
92 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
93 |
|
94 |
if response.status_code == 503:
|
95 |
response_json = response.json()
|
|
|
124 |
}
|
125 |
}
|
126 |
|
127 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
128 |
|
129 |
if response.status_code == 503:
|
130 |
response_json = response.json()
|