Spaces:
Sleeping
Sleeping
Commit
·
cd4505d
1
Parent(s):
9ec7f06
Update app.py
Browse files
app.py
CHANGED
@@ -8,10 +8,9 @@ temperature = 0
|
|
8 |
|
9 |
prompt = st.text_area("Prompt")
|
10 |
|
11 |
-
if st.button("Submit"):
|
12 |
st.markdown("----")
|
13 |
-
|
14 |
-
share_box = st.empty()
|
15 |
|
16 |
content = []
|
17 |
for chunk in openai.ChatCompletion.create(
|
@@ -23,12 +22,12 @@ if st.button("Submit"):
|
|
23 |
chunk_content = chunk["choices"][0].get("delta", {}).get("content")
|
24 |
if chunk_content is not None:
|
25 |
content.append(chunk_content)
|
26 |
-
|
27 |
-
|
28 |
st.markdown("----")
|
29 |
st.subheader("共有用")
|
30 |
-
|
31 |
-
|
32 |
f"""
|
33 |
````
|
34 |
### Prompt
|
@@ -38,7 +37,7 @@ if st.button("Submit"):
|
|
38 |
|
39 |
### Output
|
40 |
```
|
41 |
-
{
|
42 |
```
|
43 |
````
|
44 |
"""
|
|
|
8 |
|
9 |
prompt = st.text_area("Prompt")
|
10 |
|
11 |
+
if st.button("Submit", type="primary"):
|
12 |
st.markdown("----")
|
13 |
+
output_box = st.empty()
|
|
|
14 |
|
15 |
content = []
|
16 |
for chunk in openai.ChatCompletion.create(
|
|
|
22 |
chunk_content = chunk["choices"][0].get("delta", {}).get("content")
|
23 |
if chunk_content is not None:
|
24 |
content.append(chunk_content)
|
25 |
+
output = "".join(content).strip()
|
26 |
+
output_box.markdown(output)
|
27 |
st.markdown("----")
|
28 |
st.subheader("共有用")
|
29 |
+
output = "".join(content).strip()
|
30 |
+
st.markdown(
|
31 |
f"""
|
32 |
````
|
33 |
### Prompt
|
|
|
37 |
|
38 |
### Output
|
39 |
```
|
40 |
+
{output}
|
41 |
```
|
42 |
````
|
43 |
"""
|