bstraehle commited on
Commit
5e0acb9
1 Parent(s): 6f50ad0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -12
app.py CHANGED
@@ -118,16 +118,9 @@ def chat(message, history, openai_api_key):
118
  def vote(data: gr.LikeData):
119
  print("voted")
120
 
121
- with gr.Blocks() as demo:
122
- gr.Textbox("sk-", label="OpenAI API Key", type = "password")
123
-
124
- chatbot = gr.Chatbot(placeholder="<strong>Your Personal Yes-Man</strong><br>Ask Me Anything")
125
-
126
- chatbot.like(vote, None, None)
127
-
128
- gr.ChatInterface(
129
  fn=chat,
130
- chatbot=chatbot,
131
  textbox=gr.Textbox(placeholder="Ask anything", container=False, scale=7),
132
  title="Python Code Generator",
133
  description="Generate, explain, fix, optimize, document, test, help, ... Can execute code when asked to.",
@@ -145,6 +138,4 @@ with gr.Blocks() as demo:
145
  additional_inputs=[
146
  gr.Textbox("sk-", label="OpenAI API Key", type = "password"),
147
  ],
148
- )
149
-
150
- demo.launch()
 
118
  def vote(data: gr.LikeData):
119
  print("voted")
120
 
121
+ gr.ChatInterface(
 
 
 
 
 
 
 
122
  fn=chat,
123
+ chatbot=chatbot=gr.Chatbot(height=300),
124
  textbox=gr.Textbox(placeholder="Ask anything", container=False, scale=7),
125
  title="Python Code Generator",
126
  description="Generate, explain, fix, optimize, document, test, help, ... Can execute code when asked to.",
 
138
  additional_inputs=[
139
  gr.Textbox("sk-", label="OpenAI API Key", type = "password"),
140
  ],
141
+ ).launch()