Dagfinn1962 commited on
Commit
b369e83
1 Parent(s): 9488489

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -32
app.py CHANGED
@@ -103,7 +103,7 @@ config.read('config.ini')
103
  openai_key = config.get('Credentials', 'openai_key')
104
 
105
 
106
- with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
107
  gr.Markdown(
108
  """
109
  <br><h1><center>Chat with gpt-3.5-turbo</center></h1>
@@ -145,39 +145,36 @@ with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
145
  "biased, or otherwise offensive outputs.",
146
  elem_classes=["disclaimer"],
147
  )
148
- with gr.Row():
149
- gr.Markdown(
150
- "[Privacy policy](https://gist.github.com/samhavens/c29c68cdcd420a9aa0202d0839876dac)",
151
- elem_classes=["disclaimer"],
152
- )
153
-
154
- submit_event = msg.submit(
155
- fn=conversation.user_turn,
156
- inputs=[msg],
157
- outputs=[msg, chatbot],
158
- queue=False,
159
- ).then(
160
- fn=conversation.bot_turn,
161
- inputs=[system, chatbot, openai_key],
162
- outputs=[chatbot],
163
- keep_in_queue=True, # Change `queue=True` to `keep_in_queue=True`
164
- )
165
-
166
- submit_click_event = submit.click(
167
- fn=conversation.user_turn,
168
- inputs=[msg],
169
- outputs=[msg, chatbot],
170
- queue=False,
171
- ).then(
172
- fn=conversation.bot_turn,
173
- inputs=[system, chatbot, openai_key],
174
- outputs=[chatbot],
175
- keep_in_queue=True, # Change `queue=True` to `keep_in_queue=True`
176
- )
177
-
178
- stop.click(...)
179
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
180
 
 
181
  fn=None,
182
  inputs=None,
183
  outputs=None,
 
103
  openai_key = config.get('Credentials', 'openai_key')
104
 
105
 
106
+ with gr.Blocks(theme='HaleyCH/HaleyCH_Theme') as demo:
107
  gr.Markdown(
108
  """
109
  <br><h1><center>Chat with gpt-3.5-turbo</center></h1>
 
145
  "biased, or otherwise offensive outputs.",
146
  elem_classes=["disclaimer"],
147
  )
148
+ with gr.Row():
149
+ gr.Markdown(
150
+ "[Privacy policy](https://gist.github.com/samhavens/c29c68cdcd420a9aa0202d0839876dac)",
151
+ elem_classes=["disclaimer"],
152
+ )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
 
154
+ submit_event = msg.submit(
155
+ fn=conversation.user_turn,
156
+ inputs=[msg],
157
+ outputs=[msg, chatbot],
158
+ queue=False,
159
+ ).then(
160
+ fn=conversation.bot_turn,
161
+ inputs=[system, chatbot, openai_key],
162
+ outputs=[chatbot],
163
+ keep_in_queue=True, # Change `queue=True` to `keep_in_queue=True`
164
+ )
165
+ submit_click_event = submit.click(
166
+ fn=conversation.user_turn,
167
+ inputs=[msg],
168
+ outputs=[msg, chatbot],
169
+ queue=False,
170
+ ).then(
171
+ fn=conversation.bot_turn,
172
+ inputs=[system, chatbot, openai_key],
173
+ outputs=[chatbot],
174
+ keep_in_queue=True, # Change `queue=True` to `keep_in_queue=True`
175
+ )
176
 
177
+ stop.click(...)
178
  fn=None,
179
  inputs=None,
180
  outputs=None,