xiaolv commited on
Commit
5a700de
1 Parent(s): c9e9a60

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -1
app.py CHANGED
@@ -10,8 +10,13 @@ import re
10
  参考资料:
11
  https://www.bilibili.com/video/BV1KV4y197bX/?spm_id_from=333.1007.tianma.2-2-5.click&vd_source=9dc7baa799a4531df364244d2e87ee01
12
  https://blog.csdn.net/xmh_free/article/details/127210992
 
 
 
 
13
  """
14
 
 
15
  # read cookie from local file
16
  # with open('./cookies.json', 'r') as f:
17
  # cookies = json.load(f)
@@ -47,7 +52,9 @@ async def get_model_reply(prompt,style,cookies,context=[]):
47
  responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
48
  return responses, context
49
 
 
50
  except:
 
51
  try:
52
  if raw_data["item"]["throttling"]["numUserMessagesInConversation"] > raw_data["item"]["throttling"][
53
  "maxNumUserMessagesInConversation"]:
@@ -72,7 +79,13 @@ async def get_model_reply(prompt,style,cookies,context=[]):
72
  responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
73
  return responses, context
74
 
75
-
 
 
 
 
 
 
76
 
77
 
78
  with gr.Blocks() as dialog_app:
@@ -86,6 +99,8 @@ with gr.Blocks() as dialog_app:
86
  如果回复为 "0" , 请刷新网页重来。
87
  如果回复为 "-1" , 需要重新利用梯子去激活一下聊天功能。
88
  如果回复为 "-2" , 说明该账号需要登录bing聊天页面进行人机验证。
 
 
89
  """)
90
 
91
  chatbot = gr.Chatbot()
 
10
  参考资料:
11
  https://www.bilibili.com/video/BV1KV4y197bX/?spm_id_from=333.1007.tianma.2-2-5.click&vd_source=9dc7baa799a4531df364244d2e87ee01
12
  https://blog.csdn.net/xmh_free/article/details/127210992
13
+
14
+
15
+ python3 -m pip install EdgeGPT --upgrade
16
+ https://github.com/acheong08/EdgeGPT/blob/0.4.4/src/EdgeGPT.py
17
  """
18
 
19
+
20
  # read cookie from local file
21
  # with open('./cookies.json', 'r') as f:
22
  # cookies = json.load(f)
 
52
  responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
53
  return responses, context
54
 
55
+
56
  except:
57
+
58
  try:
59
  if raw_data["item"]["throttling"]["numUserMessagesInConversation"] > raw_data["item"]["throttling"][
60
  "maxNumUserMessagesInConversation"]:
 
79
  responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
80
  return responses, context
81
 
82
+
83
+
84
+
85
+ # inputs= "你好"
86
+ # cookies = list_wo = r"E:\pythonProjectWork\xiaolv\mew-bing\zzceshi的.json"
87
+ # a,b = get_model_reply(prompt=inputs,style="precise",cookies = cookies)
88
+
89
 
90
 
91
  with gr.Blocks() as dialog_app:
 
99
  如果回复为 "0" , 请刷新网页重来。
100
  如果回复为 "-1" , 需要重新利用梯子去激活一下聊天功能。
101
  如果回复为 "-2" , 说明该账号需要登录bing聊天页面进行人机验证。
102
+
103
+ ### 由于源码的更新,此时传入 [ choices = None ] 才能返回要求的格式。即不选择特定的choices模式
104
  """)
105
 
106
  chatbot = gr.Chatbot()