Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -25,18 +25,16 @@ def infer(prompt, max_new_tokens=10, temperature=0.0, top_p=1.0):
|
|
25 |
"source": "dalle",
|
26 |
}
|
27 |
|
28 |
-
|
29 |
-
|
30 |
-
job_id = res['id']
|
31 |
|
32 |
while True:
|
|
|
|
|
33 |
|
34 |
ret = requests.get(f"https://planetd.shift.ml/job/{job_id}", json={'id': job_id}).json()
|
35 |
|
36 |
if ret['status'] == 'finished':
|
37 |
break
|
38 |
-
|
39 |
-
time.sleep(1)
|
40 |
|
41 |
return ret['returned_payload']['result']['inference_result'][0]['choices'][0]['text']
|
42 |
|
@@ -51,15 +49,14 @@ prompt = st.text_area(
|
|
51 |
height=400,
|
52 |
)
|
53 |
|
54 |
-
|
55 |
generated_area = st.empty()
|
56 |
generated_area.markdown("(Generate here)")
|
57 |
|
58 |
button_submit = st.button("Submit")
|
59 |
|
60 |
-
max_new_tokens = st.
|
61 |
-
temperature = st.
|
62 |
-
top_p = st.
|
63 |
|
64 |
if button_submit:
|
65 |
with st.spinner(text="In progress.."):
|
|
|
25 |
"source": "dalle",
|
26 |
}
|
27 |
|
28 |
+
job_id = requests.post("https://planetd.shift.ml/jobs", json=my_post_dict).json()['id']
|
|
|
|
|
29 |
|
30 |
while True:
|
31 |
+
|
32 |
+
time.sleep(1)
|
33 |
|
34 |
ret = requests.get(f"https://planetd.shift.ml/job/{job_id}", json={'id': job_id}).json()
|
35 |
|
36 |
if ret['status'] == 'finished':
|
37 |
break
|
|
|
|
|
38 |
|
39 |
return ret['returned_payload']['result']['inference_result'][0]['choices'][0]['text']
|
40 |
|
|
|
49 |
height=400,
|
50 |
)
|
51 |
|
|
|
52 |
generated_area = st.empty()
|
53 |
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.."):
|