zss2341 commited on
Commit
fe317da
0 Parent(s):

Duplicate from zss2341/chatgpt_webui_public

Browse files
Files changed (5) hide show
  1. .gitattributes +34 -0
  2. LICENSE +28 -0
  3. README.md +16 -0
  4. app.py +48 -0
  5. requirements.txt +2 -0
.gitattributes ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tflite filter=lfs diff=lfs merge=lfs -text
29
+ *.tgz filter=lfs diff=lfs merge=lfs -text
30
+ *.wasm filter=lfs diff=lfs merge=lfs -text
31
+ *.xz filter=lfs diff=lfs merge=lfs -text
32
+ *.zip filter=lfs diff=lfs merge=lfs -text
33
+ *.zst filter=lfs diff=lfs merge=lfs -text
34
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
LICENSE ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2023, Mension
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
README.md ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: bsd-2-clause
3
+ title: ChatGPT WebUI
4
+ sdk: gradio
5
+ emoji: 👀
6
+ colorFrom: yellow
7
+ colorTo: red
8
+ app_file: app.py
9
+ duplicated_from: zss2341/chatgpt_webui_public
10
+ ---
11
+ # chatgpt_webui
12
+ Build an WebUI of ChatGPT with multiple authentication method using Gradio and revChatGPT
13
+
14
+ clone this space to run for your own account
15
+
16
+ ### This project will not SAVE/DISPLAY/SHARE the ACCOUNT INFO of any user!!
app.py ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from revChatGPT.V1 import Chatbot
3
+ import os
4
+
5
+ email = os.environ.get('email')
6
+ password = os.environ.get('password')
7
+ access_token = None
8
+ session_token = None
9
+
10
+ def configure_chatbot():
11
+
12
+ config = {}
13
+ config.update({"email": email,
14
+ "password": password})
15
+
16
+
17
+ global chatbot
18
+ chatbot = Chatbot(config=config)
19
+
20
+ login_method = ['Email/Password']
21
+
22
+ def ask_bot(prompt):
23
+ message = ""
24
+ for data in chatbot.ask(prompt):
25
+ message = data["message"]
26
+ return message
27
+
28
+ def chatgpt_clone(inputs, history):
29
+ history = history or []
30
+ output = ask_bot(inputs)
31
+ history.append((inputs, output))
32
+ return history, history
33
+
34
+ with gr.Blocks() as demo:
35
+ gr.Markdown("""<h1><center>这是一个代理,用于实现免翻</center></h1> """)
36
+ gr.Markdown("#### 作者不便署名,直接使用就行")
37
+ gr.Markdown("#### 用爱发电甚难,不要随便乱谈")
38
+
39
+ configure_chatbot()
40
+
41
+ gr.Markdown("""<h2>Start Chatting ...</h2>""")
42
+ chatbot1 = gr.Chatbot()
43
+ message = gr.Textbox(placeholder="Chat here")
44
+ state = gr.State()
45
+ submit = gr.Button("SEND")
46
+ submit.click(chatgpt_clone, inputs=[message, state], outputs=[chatbot1, state])
47
+
48
+ demo.launch(debug = True, share=False)
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ revChatGPT
2
+ gradio