Spaces:
Runtime error
Runtime error
remove print lines
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ MODELS = {
|
|
20 |
|
21 |
def query(payload, model_name):
|
22 |
data = json.dumps(payload)
|
23 |
-
print("model url:", MODELS[model_name]["url"])
|
24 |
response = requests.request("POST", MODELS[model_name]["url"], headers=headers, data=data)
|
25 |
return json.loads(response.content.decode("utf-8"))
|
26 |
|
@@ -108,7 +108,7 @@ text = st.text_area("Enter text", prompt_box)
|
|
108 |
if st.button("Run"):
|
109 |
with st.spinner(text="Getting results..."):
|
110 |
st.subheader("Result")
|
111 |
-
print(f"maxlen:{max_len}, temp:{temp}, top_k:{top_k}, top_p:{top_p}")
|
112 |
result = process(text=text,
|
113 |
model_name=model_name,
|
114 |
max_len=int(max_len),
|
@@ -116,7 +116,7 @@ if st.button("Run"):
|
|
116 |
top_k=int(top_k),
|
117 |
top_p=float(top_p))
|
118 |
|
119 |
-
print("result:", result)
|
120 |
if "error" in result:
|
121 |
if type(result["error"]) is str:
|
122 |
st.write(f'{result["error"]}.', end=" ")
|
|
|
20 |
|
21 |
def query(payload, model_name):
|
22 |
data = json.dumps(payload)
|
23 |
+
# print("model url:", MODELS[model_name]["url"])
|
24 |
response = requests.request("POST", MODELS[model_name]["url"], headers=headers, data=data)
|
25 |
return json.loads(response.content.decode("utf-8"))
|
26 |
|
|
|
108 |
if st.button("Run"):
|
109 |
with st.spinner(text="Getting results..."):
|
110 |
st.subheader("Result")
|
111 |
+
# print(f"maxlen:{max_len}, temp:{temp}, top_k:{top_k}, top_p:{top_p}")
|
112 |
result = process(text=text,
|
113 |
model_name=model_name,
|
114 |
max_len=int(max_len),
|
|
|
116 |
top_k=int(top_k),
|
117 |
top_p=float(top_p))
|
118 |
|
119 |
+
# print("result:", result)
|
120 |
if "error" in result:
|
121 |
if type(result["error"]) is str:
|
122 |
st.write(f'{result["error"]}.', end=" ")
|