ajwthompson commited on
Commit
ade681e
·
1 Parent(s): fdbc237

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -6
app.py CHANGED
@@ -51,7 +51,7 @@ class ChatWrapper:
51
 
52
  chat = ChatWrapper()
53
  state = gr.State()
54
- agent_state = gr.State()
55
  def echo(name, request: gr.Request):
56
  if request:
57
  print("Request headers dictionary:", request.headers)
@@ -62,11 +62,7 @@ def echo(name, request: gr.Request):
62
  def my_inference_function(name):
63
  return "Hello " + name + "!"
64
 
65
- gradio_interface = gr.Interface(
66
- fn = chat,
67
- inputs = ["text"],
68
- outputs = ["text"]
69
- )
70
  gradio_interface.launch()
71
 
72
 
 
51
 
52
  chat = ChatWrapper()
53
  state = gr.State()
54
+ agent_state = gr.State(set_openai_api_key('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'))
55
  def echo(name, request: gr.Request):
56
  if request:
57
  print("Request headers dictionary:", request.headers)
 
62
  def my_inference_function(name):
63
  return "Hello " + name + "!"
64
 
65
+ gradio_interface = gr.Interface(chat, inputs=[openai_api_key_textbox, message, state, agent_state], outputs=[chatbot, state])
 
 
 
 
66
  gradio_interface.launch()
67
 
68