hectorjelly commited on
Commit
44c92af
1 Parent(s): 92bae8d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -37,7 +37,7 @@ def ask_joe(api_key, text, clear):
37
  "Only answer questions on poker topics"
38
  }
39
  ]
40
- return "Conversation cleared.", False
41
 
42
  # set up the api_key
43
  setup_openai(api_key)
@@ -70,7 +70,7 @@ def ask_joe(api_key, text, clear):
70
  f.write(f'User: {text}\n')
71
  f.write(f'AI: {model_message}\n')
72
 
73
- return model_message, False
74
 
75
  iface = gr.Interface(
76
  fn=ask_joe,
@@ -79,10 +79,7 @@ iface = gr.Interface(
79
  gr.inputs.Textbox(label="Enter your question here. More detail = Better results"),
80
  gr.inputs.Checkbox(label="Clear Conversation")
81
  ],
82
- outputs=[
83
- gr.outputs.Textbox(label="Joe's Response"),
84
- gr.outputs.Checkbox(label="Clear Conversation") # The 'clear' state, will show unchecked after clearing
85
- ]
86
  )
87
 
88
  iface.launch()
 
37
  "Only answer questions on poker topics"
38
  }
39
  ]
40
+ return "Conversation cleared."
41
 
42
  # set up the api_key
43
  setup_openai(api_key)
 
70
  f.write(f'User: {text}\n')
71
  f.write(f'AI: {model_message}\n')
72
 
73
+ return model_message
74
 
75
  iface = gr.Interface(
76
  fn=ask_joe,
 
79
  gr.inputs.Textbox(label="Enter your question here. More detail = Better results"),
80
  gr.inputs.Checkbox(label="Clear Conversation")
81
  ],
82
+ outputs=gr.outputs.Textbox(label="Joe's Response")
 
 
 
83
  )
84
 
85
  iface.launch()