Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,11 +5,11 @@ from huggingface_hub import InferenceClient
|
|
| 5 |
"""
|
| 6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 7 |
"""
|
| 8 |
-
|
| 9 |
headers = {
|
| 10 |
-
'Authorization': f'Bearer {
|
| 11 |
}
|
| 12 |
-
client = InferenceClient(model="meta-llama/Meta-Llama-3-8B-Instruct",headers=headers,token=
|
| 13 |
|
| 14 |
|
| 15 |
def respond(
|
|
@@ -26,8 +26,8 @@ def respond(
|
|
| 26 |
print(temperature)
|
| 27 |
print(top_p)
|
| 28 |
print(message)
|
| 29 |
-
print(token)
|
| 30 |
-
print(headers)
|
| 31 |
for val in history:
|
| 32 |
if val[0]:
|
| 33 |
messages.append({"role": "user", "content": val[0]})
|
|
|
|
| 5 |
"""
|
| 6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
| 7 |
"""
|
| 8 |
+
api_token = os.environ.get("API_TOKEN")
|
| 9 |
headers = {
|
| 10 |
+
'Authorization': f'Bearer {api_token}'
|
| 11 |
}
|
| 12 |
+
client = InferenceClient(model="meta-llama/Meta-Llama-3-8B-Instruct",headers=headers,token=api_token)
|
| 13 |
|
| 14 |
|
| 15 |
def respond(
|
|
|
|
| 26 |
print(temperature)
|
| 27 |
print(top_p)
|
| 28 |
print(message)
|
| 29 |
+
#print(token)
|
| 30 |
+
#print(headers)
|
| 31 |
for val in history:
|
| 32 |
if val[0]:
|
| 33 |
messages.append({"role": "user", "content": val[0]})
|