Spaces:
Runtime error
Runtime error
Update TextGen/router.py
Browse files- TextGen/router.py +2 -1
TextGen/router.py
CHANGED
|
@@ -50,9 +50,10 @@ def api_home():
|
|
| 50 |
|
| 51 |
|
| 52 |
API_URL = "https://api-inference.huggingface.co/models/google/gemma-1.1-7b-it"
|
|
|
|
| 53 |
|
| 54 |
def query(payload):
|
| 55 |
-
response = requests.post(API_URL, json=payload)
|
| 56 |
return response.json()
|
| 57 |
|
| 58 |
@app.get("/query", tags=["Query"])
|
|
|
|
| 50 |
|
| 51 |
|
| 52 |
API_URL = "https://api-inference.huggingface.co/models/google/gemma-1.1-7b-it"
|
| 53 |
+
headers = {"Authorization": f"Bearer {config.HF_TOKEN}"}
|
| 54 |
|
| 55 |
def query(payload):
|
| 56 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
| 57 |
return response.json()
|
| 58 |
|
| 59 |
@app.get("/query", tags=["Query"])
|