Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,10 @@ import time
|
|
4 |
|
5 |
def infer(prompt, model_name, max_new_tokens=10, temperature=0.0, top_p=1.0):
|
6 |
|
|
|
|
|
|
|
|
|
7 |
my_post_dict = {
|
8 |
"type": "general",
|
9 |
"payload": {
|
@@ -11,7 +15,7 @@ def infer(prompt, model_name, max_new_tokens=10, temperature=0.0, top_p=1.0):
|
|
11 |
"n": 1,
|
12 |
"temperature": float(temperature),
|
13 |
"top_p": float(top_p),
|
14 |
-
"model": model_name,
|
15 |
"prompt": [prompt],
|
16 |
"request_type": "language-model-inference",
|
17 |
"stop": None,
|
@@ -54,7 +58,7 @@ generated_area.markdown("(Generate here)")
|
|
54 |
|
55 |
button_submit = st.button("Submit")
|
56 |
|
57 |
-
model_name = st.selectbox("Model", ["
|
58 |
max_new_tokens = st.text_input('Max new tokens', "10")
|
59 |
temperature = st.text_input('temperature', "0.0")
|
60 |
top_p = st.text_input('top_p', "1.0")
|
|
|
4 |
|
5 |
def infer(prompt, model_name, max_new_tokens=10, temperature=0.0, top_p=1.0):
|
6 |
|
7 |
+
model_name_map = {
|
8 |
+
"GPT-JT-6B-v1": "Together-gpt-JT-6B-v1",
|
9 |
+
}
|
10 |
+
|
11 |
my_post_dict = {
|
12 |
"type": "general",
|
13 |
"payload": {
|
|
|
15 |
"n": 1,
|
16 |
"temperature": float(temperature),
|
17 |
"top_p": float(top_p),
|
18 |
+
"model": model_name_map[model_name],
|
19 |
"prompt": [prompt],
|
20 |
"request_type": "language-model-inference",
|
21 |
"stop": None,
|
|
|
58 |
|
59 |
button_submit = st.button("Submit")
|
60 |
|
61 |
+
model_name = st.selectbox("Model", ["GPT-JT-6B-v1"])
|
62 |
max_new_tokens = st.text_input('Max new tokens', "10")
|
63 |
temperature = st.text_input('temperature', "0.0")
|
64 |
top_p = st.text_input('top_p', "1.0")
|