xiaolv commited on
Commit
ca24d54
·
1 Parent(s): ac1adc1

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -9
app.py CHANGED
@@ -5,8 +5,8 @@ import os
5
  from EdgeGPT import Chatbot, ConversationStyle
6
 
7
  # read cookie from local file
8
- # with open('./cookies.json', 'r') as f:
9
- # cookies = json.load(f)
10
 
11
  async def get_model_reply(prompt,style,cookies,context=[]):
12
  # combines the new question with a previous context
@@ -25,16 +25,11 @@ async def get_model_reply(prompt,style,cookies,context=[]):
25
  responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
26
 
27
  return responses, context
28
- # query = 'Which is the largest country by area in the world?'
29
- # style="precise"
30
- # responses, context =asyncio.run(get_model_reply(query,style,context=[]))
31
 
32
- # print(' ' + responses[-1][0])
33
- # print(' ' + responses[-1][1])
34
  with gr.Blocks() as dialog_app:
35
 
36
- with gr.Tab("Cookies"):
37
- cookies = gr.Textbox(lines=2, label="输入bing.com中的cookies")
38
  with gr.Tab("New Bing Chat GPT4"):
39
  gr.Markdown("# 连接 new-bing 接口,用的是GPT4的接口")
40
  chatbot = gr.Chatbot()
 
5
  from EdgeGPT import Chatbot, ConversationStyle
6
 
7
  # read cookie from local file
8
+ with open('./cookies.json', 'r') as f:
9
+ cookies = json.load(f)
10
 
11
  async def get_model_reply(prompt,style,cookies,context=[]):
12
  # combines the new question with a previous context
 
25
  responses = [(u, b) for u, b in zip(context[::2], context[1::2])]
26
 
27
  return responses, context
 
 
 
28
 
 
 
29
  with gr.Blocks() as dialog_app:
30
 
31
+ # with gr.Tab("Cookies"):
32
+ # cookies = gr.Textbox(lines=2, label="输入bing.com中的cookies")
33
  with gr.Tab("New Bing Chat GPT4"):
34
  gr.Markdown("# 连接 new-bing 接口,用的是GPT4的接口")
35
  chatbot = gr.Chatbot()