Added GUI
Browse files- README.md +3 -0
- requirements.txt +2 -1
- streamlit_app.py +43 -0
README.md
CHANGED
@@ -74,6 +74,9 @@ install requirements with:
|
|
74 |
```sh
|
75 |
pip3 install -r requirements.txt
|
76 |
```
|
|
|
|
|
|
|
77 |
|
78 |
## ChatGPT clone
|
79 |
> currently implementing new features and trying to scale it, please be patient it may be unstable
|
|
|
74 |
```sh
|
75 |
pip3 install -r requirements.txt
|
76 |
```
|
77 |
+
## To start gpt4free GUI
|
78 |
+
To start gpt4free GUI run the following command :
|
79 |
+
`streamlit run streamlit_app.py`
|
80 |
|
81 |
## ChatGPT clone
|
82 |
> currently implementing new features and trying to scale it, please be patient it may be unstable
|
requirements.txt
CHANGED
@@ -4,4 +4,5 @@ tls-client
|
|
4 |
pypasser
|
5 |
names
|
6 |
colorama
|
7 |
-
curl_cffi
|
|
|
|
4 |
pypasser
|
5 |
names
|
6 |
colorama
|
7 |
+
curl_cffi
|
8 |
+
streamlit==1.21.0
|
streamlit_app.py
ADDED
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import phind
|
3 |
+
|
4 |
+
def phind_get_answer(question:str)->str:
|
5 |
+
# set cf_clearance cookie
|
6 |
+
phind.cf_clearance = 'heguhSRBB9d0sjLvGbQECS8b80m2BQ31xEmk9ChshKI-1682268995-0-160'
|
7 |
+
phind.user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
|
8 |
+
result = phind.Completion.create(
|
9 |
+
model = 'gpt-4',
|
10 |
+
prompt = question,
|
11 |
+
results = phind.Search.create(question, actualSearch = True),
|
12 |
+
creative = False,
|
13 |
+
detailed = False,
|
14 |
+
codeContext = '')
|
15 |
+
return result.completion.choices[0].text
|
16 |
+
|
17 |
+
|
18 |
+
st.set_page_config(
|
19 |
+
page_title="gpt4freeGUI",
|
20 |
+
initial_sidebar_state="expanded",
|
21 |
+
page_icon="🧠",
|
22 |
+
menu_items={
|
23 |
+
'Get Help': 'https://github.com/xtekky/gpt4free/blob/main/README.md',
|
24 |
+
'Report a bug': "https://github.com/xtekky/gpt4free/issues",
|
25 |
+
'About': "### gptfree GUI"
|
26 |
+
}
|
27 |
+
)
|
28 |
+
|
29 |
+
st.header('GPT4free GUI')
|
30 |
+
|
31 |
+
question_text_area = st.text_area('🤖 Ask Any Question :', placeholder='Explain quantum computing in 50 words')
|
32 |
+
if st.button('🧠 Think'):
|
33 |
+
answer = phind_get_answer(question_text_area)
|
34 |
+
st.caption("Answer :")
|
35 |
+
st.markdown(answer)
|
36 |
+
|
37 |
+
|
38 |
+
hide_streamlit_style = """
|
39 |
+
<style>
|
40 |
+
footer {visibility: hidden;}
|
41 |
+
</style>
|
42 |
+
"""
|
43 |
+
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|