Nymbo commited on
Commit
6ee17e0
·
verified ·
1 Parent(s): 901bafe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -22
app.py CHANGED
@@ -159,9 +159,9 @@ def set_custom_model_from_radio(selected):
159
  return selected
160
 
161
  # IMPORTANT: Because we have 1 main user input + 7 additional inputs,
162
- # each example should be an 8-item list [user_text, system_prompt, max_tokens, temperature,
163
- # top_p, frequency_penalty, seed, custom_model].
164
- # You can adjust the default parameter values if desired.
165
  demo = gr.ChatInterface(
166
  fn=respond,
167
  additional_inputs=[
@@ -176,28 +176,43 @@ demo = gr.ChatInterface(
176
  fill_height=True,
177
  chatbot=chatbot,
178
  theme="Nymbo/Nymbo_Theme",
179
- )
180
- print("ChatInterface object created.")
181
-
182
- # Add examples to the interface
183
- demo.add_examples(
184
  examples=[
185
- ["Howdy, partner!", "You are a friendly assistant.", 512, 0.7, 0.95, 0.0, -1, ""],
186
- ["What's your model name and who trained you?", "You are a factual assistant.", 512, 0.7, 0.95, 0.0, -1, ""],
187
- ["How many R's are there in 'Strawberry'?", "You are a playful assistant.", 512, 0.7, 0.95, 0.0, -1, ""],
188
- ],
189
- inputs=[
190
- chatbot,
191
- system_message_box,
192
- max_tokens_slider,
193
- temperature_slider,
194
- top_p_slider,
195
- frequency_penalty_slider,
196
- seed_slider,
197
- custom_model_box,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  ],
199
  )
200
- print("Examples added to the interface.")
201
 
202
  with demo:
203
  with gr.Accordion("Featured Models", open=False):
 
159
  return selected
160
 
161
  # IMPORTANT: Because we have 1 main user input + 7 additional inputs,
162
+ # each example should be an 8-item list: [user_text, system_prompt, max_tokens,
163
+ # temperature, top_p, frequency_penalty, seed, custom_model].
164
+
165
  demo = gr.ChatInterface(
166
  fn=respond,
167
  additional_inputs=[
 
176
  fill_height=True,
177
  chatbot=chatbot,
178
  theme="Nymbo/Nymbo_Theme",
 
 
 
 
 
179
  examples=[
180
+ # Example 1
181
+ [
182
+ "Howdy, partner!", # user_text
183
+ "", # system_prompt
184
+ 512, # max_tokens
185
+ 0.7, # temperature
186
+ 0.95, # top_p
187
+ 0.0, # frequency_penalty
188
+ -1, # seed
189
+ "" # custom_model
190
+ ],
191
+ # Example 2
192
+ [
193
+ "What's your model name and who trained you?",
194
+ "",
195
+ 512,
196
+ 0.7,
197
+ 0.95,
198
+ 0.0,
199
+ -1,
200
+ ""
201
+ ],
202
+ # Example 3
203
+ [
204
+ "How many R's are there in 'Strawberry'?",
205
+ "",
206
+ 512,
207
+ 0.7,
208
+ 0.95,
209
+ 0.0,
210
+ -1,
211
+ ""
212
+ ],
213
  ],
214
  )
215
+ print("ChatInterface object created.")
216
 
217
  with demo:
218
  with gr.Accordion("Featured Models", open=False):