slush0 commited on
Commit
2f09f5b
·
1 Parent(s): 104f494

Hide raw output to Accordion to make the UI less heavy.

Browse files
Files changed (1) hide show
  1. chat.py +9 -6
chat.py CHANGED
@@ -116,7 +116,8 @@ with gr.Blocks() as iface_chat:
116
  # Switch between sampling and greedy generation
117
  do_sample = gr.Checkbox(value=True, interactive=True, label="do_sample")
118
  context = gr.Textbox(lines=3, label="Initial context:", interactive=True,
119
- value="A human talks to a powerful AI that follows the human's instructions.</s>\n"
 
120
  "Human: Hi!</s>\n"
121
  "AI: How can I help you?")
122
 
@@ -130,7 +131,7 @@ with gr.Blocks() as iface_chat:
130
 
131
 
132
  chat = gr.Chatbot(label='Chat window')
133
- prompt = gr.Textbox(show_label=False,
134
  placeholder="Prompt Here and press Enter...").style(container=False)
135
 
136
  with gr.Row():
@@ -138,7 +139,8 @@ with gr.Blocks() as iface_chat:
138
  # button_clear = gr.Button("Clear session") # TODO
139
  # button_stop = gr.Button("Stop") # TODO, not supported by websocket API yet.
140
 
141
- output = gr.Textbox(lines=3, label='Raw Prompt Log')
 
142
 
143
  # Chat history
144
  state = gr.State([])
@@ -152,9 +154,10 @@ with gr.Blocks() as iface_chat:
152
 
153
  examples = gr.Examples(inputs=[context, prompt, model, do_sample, top_k, top_p, temperature],
154
  examples=[
155
- ["A human talks to a powerful AI that follows the human's instructions.</s>\n"
 
156
  "Human: Hi!</s>\n"
157
  "AI: Hi! How can I help you?",
158
- "Could you remind me please what's the capital of Portugal?",
159
- "bloomz", True, 0, 0.9, 0.75]
160
  ])
 
116
  # Switch between sampling and greedy generation
117
  do_sample = gr.Checkbox(value=True, interactive=True, label="do_sample")
118
  context = gr.Textbox(lines=3, label="Initial context:", interactive=True,
119
+ value="A human talks to a powerful AI that follows the human's instructions. "
120
+ "AI is talkative, friendly, positive and provides detailed answers to any question.</s>\n"
121
  "Human: Hi!</s>\n"
122
  "AI: How can I help you?")
123
 
 
131
 
132
 
133
  chat = gr.Chatbot(label='Chat window')
134
+ prompt = gr.Textbox(show_label=False, label='Prompt',
135
  placeholder="Prompt Here and press Enter...").style(container=False)
136
 
137
  with gr.Row():
 
139
  # button_clear = gr.Button("Clear session") # TODO
140
  # button_stop = gr.Button("Stop") # TODO, not supported by websocket API yet.
141
 
142
+ with gr.Accordion("Raw prompt log", open=False):
143
+ output = gr.Textbox(lines=3, show_label=False).style(container=False)
144
 
145
  # Chat history
146
  state = gr.State([])
 
154
 
155
  examples = gr.Examples(inputs=[context, prompt, model, do_sample, top_k, top_p, temperature],
156
  examples=[
157
+ ["A Human talks to a powerful AI that follows the human's instructions. "
158
+ "AI is talkative, friendly, positive and provides detailed answers to any question.</s>\n"
159
  "Human: Hi!</s>\n"
160
  "AI: Hi! How can I help you?",
161
+ "Could you remind me please who was Neil Armstrong?",
162
+ "bloomz", True, 0, 0.9, 0.75],
163
  ])