Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import streamlit as st
|
|
| 2 |
import json
|
| 3 |
from pathlib import Path
|
| 4 |
import requests
|
| 5 |
-
from gpt4free import you
|
| 6 |
from streamlit_star_rating import st_star_rating
|
| 7 |
import requests
|
| 8 |
import time
|
|
@@ -38,9 +38,12 @@ if source == 'I want to input some text':
|
|
| 38 |
with st.spinner('Processing...'):
|
| 39 |
time.sleep(2)
|
| 40 |
st.markdown('___')
|
| 41 |
-
response = you.Completion.create(
|
| 42 |
-
prompt=f"Explain this code. Lets think Step by step. : {input_su}"
|
| 43 |
-
)
|
|
|
|
|
|
|
|
|
|
| 44 |
st.write('Results!')
|
| 45 |
st.write(response.text)
|
| 46 |
stars = st_star_rating("How satisfied are you with the response?", 5, 0, 40)
|
|
|
|
| 2 |
import json
|
| 3 |
from pathlib import Path
|
| 4 |
import requests
|
| 5 |
+
from gpt4free import you, theb
|
| 6 |
from streamlit_star_rating import st_star_rating
|
| 7 |
import requests
|
| 8 |
import time
|
|
|
|
| 38 |
with st.spinner('Processing...'):
|
| 39 |
time.sleep(2)
|
| 40 |
st.markdown('___')
|
| 41 |
+
#response = you.Completion.create(
|
| 42 |
+
#prompt=f"Explain this code. Lets think Step by step. : {input_su}"
|
| 43 |
+
#)
|
| 44 |
+
prompt=f"Explain this code. Lets think Step by step. : {input_su}"
|
| 45 |
+
for token in theb.Completion.create(prompt):
|
| 46 |
+
print(token, end='', flush=True)
|
| 47 |
st.write('Results!')
|
| 48 |
st.write(response.text)
|
| 49 |
stars = st_star_rating("How satisfied are you with the response?", 5, 0, 40)
|