Spaces:
Sleeping
Sleeping
michelebasilico
commited on
Commit
•
94ce827
1
Parent(s):
57f52ea
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import requests
|
|
|
4 |
|
5 |
start_token = "<s>"
|
6 |
start_completion = "\nRisposta:"
|
@@ -11,6 +12,7 @@ system_prompt = "Sei un assistente utile ed affidabile. Rispondi in maniera adeg
|
|
11 |
API_URL = "https://cyk11dj2ce5ybyjq.us-east-1.aws.endpoints.huggingface.cloud"
|
12 |
headers = {
|
13 |
"Accept": "application/json",
|
|
|
14 |
"Content-Type": "application/json"
|
15 |
}
|
16 |
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import pipeline
|
3 |
import requests
|
4 |
+
import os
|
5 |
|
6 |
start_token = "<s>"
|
7 |
start_completion = "\nRisposta:"
|
|
|
12 |
API_URL = "https://cyk11dj2ce5ybyjq.us-east-1.aws.endpoints.huggingface.cloud"
|
13 |
headers = {
|
14 |
"Accept": "application/json",
|
15 |
+
"Authorization": "Bearer " + os.getEnv("SECRET_TOKEN")
|
16 |
"Content-Type": "application/json"
|
17 |
}
|
18 |
|