naughtondale commited on
Commit
ae024e4
·
1 Parent(s): 327cc32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -1,8 +1,8 @@
1
  import gradio as gr
2
  import interpreter
3
 
4
- interpreter.api_key = "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"
5
- interpreter.auto_run = True
6
 
7
  def chat(input):
8
  output = interpreter.chat(input)
@@ -12,15 +12,16 @@ def reset():
12
  interpreter.reset()
13
  return "Chat history reset"
14
 
15
- iface = gr.Interface(fn=chat,
16
- inputs="text",
17
- outputs="text",
18
- examples=[
19
- ["What is the capital of France?", "Paris"],
20
- ["What is 10 + 14?", "24"]
21
- ]
22
- )
 
23
 
24
- iface.queue(reset, [], "button", concurrency_count=1)
25
 
26
  iface.launch()
 
1
  import gradio as gr
2
  import interpreter
3
 
4
+ interpreter.api_key = "YOUR_OPENAI_API_KEY"
5
+ interpreter.auto_run = True
6
 
7
  def chat(input):
8
  output = interpreter.chat(input)
 
12
  interpreter.reset()
13
  return "Chat history reset"
14
 
15
+ iface = gr.Interface(
16
+ fn=chat,
17
+ inputs="text",
18
+ outputs="text",
19
+ examples=[
20
+ ["Hello", "Hi there!"],
21
+ ["What is 2 + 2?", "4"]
22
+ ]
23
+ )
24
 
25
+ iface.queue(reset, [], "button")
26
 
27
  iface.launch()