Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
|
2 |
import requests
|
3 |
import gradio as gr
|
4 |
import spaces
|
@@ -8,14 +7,11 @@ import os
|
|
8 |
api_token = os.environ.get("TOKEN")
|
9 |
|
10 |
|
11 |
-
|
12 |
API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-llama-3-8B-Instruct"
|
13 |
headers = {"Authorization": f"Bearer {api_token}"}
|
14 |
|
15 |
-
|
16 |
@spaces.GPU
|
17 |
|
18 |
-
|
19 |
def query(payload):
|
20 |
response = requests.post(API_URL, headers=headers, json=payload)
|
21 |
return response.json()
|
@@ -40,6 +36,4 @@ iface = gr.Interface(
|
|
40 |
)
|
41 |
|
42 |
# Lancer l'interface
|
43 |
-
|
44 |
-
|
45 |
iface.launch()
|
|
|
|
|
1 |
import requests
|
2 |
import gradio as gr
|
3 |
import spaces
|
|
|
7 |
api_token = os.environ.get("TOKEN")
|
8 |
|
9 |
|
|
|
10 |
API_URL = "https://api-inference.huggingface.co/models/meta-llama/Meta-llama-3-8B-Instruct"
|
11 |
headers = {"Authorization": f"Bearer {api_token}"}
|
12 |
|
|
|
13 |
@spaces.GPU
|
14 |
|
|
|
15 |
def query(payload):
|
16 |
response = requests.post(API_URL, headers=headers, json=payload)
|
17 |
return response.json()
|
|
|
36 |
)
|
37 |
|
38 |
# Lancer l'interface
|
|
|
|
|
39 |
iface.launch()
|