Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,13 +1,15 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
"""
|
| 5 |
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
|
| 6 |
"""
|
|
|
|
| 7 |
headers = {
|
| 8 |
-
'Authorization': f'Bearer
|
| 9 |
}
|
| 10 |
-
client = InferenceClient(model="meta-llama/Meta-Llama-3-8B-Instruct",headers=headers,token=
|
| 11 |
|
| 12 |
|
| 13 |
def respond(
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import os
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 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 |
+
token = os.environ.get("API_TOKEN")
|
| 9 |
headers = {
|
| 10 |
+
'Authorization': f'Bearer {token}'
|
| 11 |
}
|
| 12 |
+
client = InferenceClient(model="meta-llama/Meta-Llama-3-8B-Instruct",headers=headers,token=token)
|
| 13 |
|
| 14 |
|
| 15 |
def respond(
|