Koshti10 commited on
Commit
4fa6af3
1 Parent(s): 6344dd8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -22,7 +22,7 @@ def user(user_message, history):
22
  def respond(message, chat_history):
23
  question = str(message)
24
  chain = openai_chain(inp_dir=dir)
25
- output = chain.get_response(query=question, k=1, model_name="gpt-3.5-turbo", type="stuff")
26
 
27
  bot_message = output
28
  chat_history.append((message, bot_message))
@@ -35,9 +35,9 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="emerald", neutral_hue="slate"))
35
  api_key_input = gr.Textbox(lines=1, label="Enter your OpenAI API Key")
36
  api_key_input_submit = api_key_input.submit(save_api_key, [api_key_input])
37
 
38
- chatbot = gr.Chatbot().style(height=750)
39
  msg = gr.Textbox(label="Send a message", placeholder="Send a message",
40
- show_label=False).style(container=False)
41
 
42
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
43
 
@@ -54,4 +54,4 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="emerald", neutral_hue="slate"))
54
 
55
 
56
  chat.queue()
57
- # chat.launch()
 
22
  def respond(message, chat_history):
23
  question = str(message)
24
  chain = openai_chain(inp_dir=dir)
25
+ output = chain.get_response(query=question, k=10, model_name="gpt-4-1106-preview", type="map_reduce")
26
 
27
  bot_message = output
28
  chat_history.append((message, bot_message))
 
35
  api_key_input = gr.Textbox(lines=1, label="Enter your OpenAI API Key")
36
  api_key_input_submit = api_key_input.submit(save_api_key, [api_key_input])
37
 
38
+ chatbot = gr.Chatbot(height=750)
39
  msg = gr.Textbox(label="Send a message", placeholder="Send a message",
40
+ show_label=False, container=False)
41
 
42
  msg.submit(respond, [msg, chatbot], [msg, chatbot])
43
 
 
54
 
55
 
56
  chat.queue()
57
+ chat.launch()