Commit ·
18f65f3
1
Parent(s): 3a417f7
Update Sentence.py
Browse files- Sentence.py +4 -0
Sentence.py
CHANGED
|
@@ -4,3 +4,7 @@ import requests
|
|
| 4 |
|
| 5 |
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_id}"
|
| 6 |
headers = {"Authorization": f"Bearer {hf_token}"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
api_url = f"https://api-inference.huggingface.co/pipeline/feature-extraction/{model_id}"
|
| 6 |
headers = {"Authorization": f"Bearer {hf_token}"}
|
| 7 |
+
|
| 8 |
+
def query(texts):
|
| 9 |
+
response = requests.post(api_url, headers=headers, json={"inputs": texts, "options":{"wait_for_model":True}})
|
| 10 |
+
return response.json()
|