ashwinR commited on
Commit
b094f4e
1 Parent(s): 76ad507

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
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)