Spaces:
Runtime error
Runtime error
add a token
Browse files
app.py
CHANGED
@@ -5,7 +5,8 @@ from prompts import PROMPT_LIST
|
|
5 |
import streamlit as st
|
6 |
import random
|
7 |
|
8 |
-
|
|
|
9 |
MODELS = {
|
10 |
"GPT-2 Small": {
|
11 |
"url": "https://api-inference.huggingface.co/models/flax-community/gpt2-small-indonesian"
|
@@ -15,7 +16,6 @@ MODELS = {
|
|
15 |
},
|
16 |
}
|
17 |
|
18 |
-
token = st.secrets["test_token"]
|
19 |
|
20 |
def query(payload, model_name):
|
21 |
data = json.dumps(payload)
|
|
|
5 |
import streamlit as st
|
6 |
import random
|
7 |
|
8 |
+
token = st.secrets["flax_community_token"]
|
9 |
+
headers = {"Authorization": f"Bearer {token}"}
|
10 |
MODELS = {
|
11 |
"GPT-2 Small": {
|
12 |
"url": "https://api-inference.huggingface.co/models/flax-community/gpt2-small-indonesian"
|
|
|
16 |
},
|
17 |
}
|
18 |
|
|
|
19 |
|
20 |
def query(payload, model_name):
|
21 |
data = json.dumps(payload)
|