Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,12 @@ import time
|
|
5 |
import random
|
6 |
import os
|
7 |
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
# 创建新的聊天频道
|
11 |
def generate_uuid():
|
@@ -215,7 +220,11 @@ def request_to_v2(message, cookie, user_id,attachment=None,delst=True,context=[]
|
|
215 |
|
216 |
try:
|
217 |
print(f"输入的问题:{message}")
|
218 |
-
|
|
|
|
|
|
|
|
|
219 |
bots = ""
|
220 |
print("a"*100)
|
221 |
for data in response.iter_lines():
|
@@ -306,7 +315,8 @@ with gr.Blocks() as dialog_app:
|
|
306 |
# 为网站设置密码防止滥用
|
307 |
# dialog_app.launch(auth=("admin", "2240560729"),show_error=True,show_api=True,share=True)
|
308 |
# dialog_app.launch(auth=("admin", "2240560729"),show_error=True)
|
309 |
-
dialog_app.launch(show_error=True,server_port = 7861)
|
|
|
310 |
# dialog_app.launch(show_error=True,show_api=True,share=True)
|
311 |
|
312 |
|
|
|
5 |
import random
|
6 |
import os
|
7 |
|
8 |
+
proxies = None
|
9 |
+
proxies = {
|
10 |
+
'http': 'http://127.0.0.1:10809',
|
11 |
+
'https': 'http://127.0.0.1:10809',
|
12 |
+
# 'socks5':"socks5://127.0.0.1:10808",
|
13 |
+
}
|
14 |
|
15 |
# 创建新的聊天频道
|
16 |
def generate_uuid():
|
|
|
220 |
|
221 |
try:
|
222 |
print(f"输入的问题:{message}")
|
223 |
+
if proxies:
|
224 |
+
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout)
|
225 |
+
else:
|
226 |
+
response = requests.post(post_msg_url, headers=headers, data=post_msg_data, verify=False, stream=False,timeout = timeout, proxies=proxies)
|
227 |
+
|
228 |
bots = ""
|
229 |
print("a"*100)
|
230 |
for data in response.iter_lines():
|
|
|
315 |
# 为网站设置密码防止滥用
|
316 |
# dialog_app.launch(auth=("admin", "2240560729"),show_error=True,show_api=True,share=True)
|
317 |
# dialog_app.launch(auth=("admin", "2240560729"),show_error=True)
|
318 |
+
# dialog_app.launch(show_error=True,server_port = 7861)
|
319 |
+
dialog_app.launch(show_error=True)
|
320 |
# dialog_app.launch(show_error=True,show_api=True,share=True)
|
321 |
|
322 |
|