Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import streamlit as st
|
|
2 |
import requests
|
3 |
import time
|
4 |
|
5 |
-
def infer(prompt, max_new_tokens=10, temperature=0.0, top_p=1.0):
|
6 |
|
7 |
my_post_dict = {
|
8 |
"type": "general",
|
@@ -11,7 +11,7 @@ def infer(prompt, 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":
|
15 |
"prompt": [prompt],
|
16 |
"request_type": "language-model-inference",
|
17 |
"stop": None,
|
@@ -54,11 +54,12 @@ generated_area.markdown("(Generate here)")
|
|
54 |
|
55 |
button_submit = st.button("Submit")
|
56 |
|
|
|
57 |
max_new_tokens = st.text_input('Max new tokens', "10")
|
58 |
temperature = st.text_input('temperature', "0.0")
|
59 |
top_p = st.text_input('top_p', "1.0")
|
60 |
|
61 |
if button_submit:
|
62 |
with st.spinner(text="In progress.."):
|
63 |
-
report_text = infer(prompt, max_new_tokens=max_new_tokens, temperature=temperature, top_p=top_p)
|
64 |
generated_area.markdown(report_text)
|
|
|
2 |
import requests
|
3 |
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",
|
|
|
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 |
|
55 |
button_submit = st.button("Submit")
|
56 |
|
57 |
+
model_name = st.selectbox("Model", ["Together-gpt-J-6B-ProxAdam-50x"])
|
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")
|
61 |
|
62 |
if button_submit:
|
63 |
with st.spinner(text="In progress.."):
|
64 |
+
report_text = infer(prompt, model_name=model_name, max_new_tokens=max_new_tokens, temperature=temperature, top_p=top_p)
|
65 |
generated_area.markdown(report_text)
|