Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,10 @@
|
|
1 |
#Text-generation endpoint for the mistral model
|
2 |
import requests, json
|
|
|
3 |
|
|
|
4 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.1"
|
5 |
-
headers = {"Authorization": "Bearer
|
6 |
"Content-Type": "application/json"}
|
7 |
|
8 |
def query(inputs, parameters=None, ENDPOINT_URL=API_URL):
|
|
|
1 |
#Text-generation endpoint for the mistral model
|
2 |
import requests, json
|
3 |
+
import os
|
4 |
|
5 |
+
hf_api_key = os.environ.get("HF_TOKEN")
|
6 |
API_URL = "https://api-inference.huggingface.co/models/mistralai/Mistral-7B-Instruct-v0.1"
|
7 |
+
headers = {"Authorization": f"Bearer {hf_api_key}",
|
8 |
"Content-Type": "application/json"}
|
9 |
|
10 |
def query(inputs, parameters=None, ENDPOINT_URL=API_URL):
|