返回提交历史
Modified
README.md
+3
-0
Modified
requirements.txt
+2
-1
Added
streamlit_app.py
+43
-0
XFEstudio/gpt4free
Added GUI
da890d85
代码差异
3 个文件
+48
-1
@@ -74,6 +74,9 @@ install requirements with:
74
74
```sh
75
75
pip3 install -r requirements.txt
76
76
```
77
## To start gpt4free GUI
78
To start gpt4free GUI run the following command :
79
`streamlit run streamlit_app.py`
77
80
78
81
## ChatGPT clone
79
82
> currently implementing new features and trying to scale it, please be patient it may be unstable
@@ -4,4 +4,5 @@ tls-client
4
4
pypasser
5
5
names
6
6
colorama
7
curl_cffi
7
curl_cffi
8
streamlit==1.21.0
@@ -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)