artificialguybr commited on
Commit
27195cc
1 Parent(s): e788115

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -35
app.py CHANGED
@@ -116,8 +116,9 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
116
  2. Choose a model
117
  3. Start chatting!
118
 
119
- ## 🔧 Advanced:
120
- - Adjust parameters in the "Advanced Settings" section
 
121
  - Upload images for multimodal interactions
122
 
123
  Enjoy your AI-powered conversation!
@@ -148,41 +149,30 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
148
  value="google/gemini-flash-1.5"
149
  )
150
 
 
 
 
 
 
 
 
151
  with gr.Accordion("Advanced Settings", open=False):
152
- with gr.Row():
153
- with gr.Column(scale=1):
154
- gr.Markdown("### Basic Parameters")
155
- temperature = gr.Slider(minimum=0, maximum=2, value=1, step=0.1, label="Temperature")
156
- max_tokens = gr.Slider(minimum=1, maximum=4096, value=1000, step=1, label="Max Tokens")
157
- top_p = gr.Slider(minimum=0, maximum=1, value=1, step=0.01, label="Top P")
158
- top_k = gr.Slider(minimum=0, maximum=100, value=0, step=1, label="Top K")
159
-
160
- with gr.Column(scale=1):
161
- gr.Markdown("### Penalty Parameters")
162
- frequency_penalty = gr.Slider(minimum=-2, maximum=2, value=0, step=0.1, label="Frequency Penalty")
163
- presence_penalty = gr.Slider(minimum=-2, maximum=2, value=0, step=0.1, label="Presence Penalty")
164
- repetition_penalty = gr.Slider(minimum=0, maximum=2, value=1, step=0.1, label="Repetition Penalty")
165
-
166
- with gr.Row():
167
- with gr.Column(scale=1):
168
- gr.Markdown("### Advanced Control")
169
- stop = gr.Textbox(label="Stop Sequence")
170
- min_p = gr.Slider(minimum=0, maximum=1, value=0, step=0.01, label="Min P")
171
- top_a = gr.Slider(minimum=0, maximum=1, value=0, step=0.01, label="Top A")
172
- seed = gr.Number(label="Seed", precision=0)
173
-
174
- with gr.Column(scale=1):
175
- gr.Markdown("### Logging and Formatting")
176
- logprobs = gr.Checkbox(label="Log Probabilities")
177
- top_logprobs = gr.Slider(minimum=0, maximum=20, value=0, step=1, label="Top Log Probabilities")
178
- logit_bias = gr.Textbox(label="Logit Bias (JSON)")
179
- response_format = gr.Textbox(label="Response Format (JSON)")
180
 
181
- with gr.Row():
182
- with gr.Column(scale=1):
183
- gr.Markdown("### Tools")
184
- tools = gr.Textbox(label="Tools (JSON Array)", lines=3)
185
- tool_choice = gr.Textbox(label="Tool Choice")
 
 
 
 
 
186
 
187
  with gr.Column(scale=2):
188
  chatbot = gr.ChatInterface(
 
116
  2. Choose a model
117
  3. Start chatting!
118
 
119
+ ## 🔧 Settings:
120
+ - Adjust basic parameters in the "Common Settings" section
121
+ - Fine-tune advanced options in the "Advanced Settings" section
122
  - Upload images for multimodal interactions
123
 
124
  Enjoy your AI-powered conversation!
 
149
  value="google/gemini-flash-1.5"
150
  )
151
 
152
+ with gr.Accordion("Common Settings", open=False):
153
+ with gr.Group():
154
+ temperature = gr.Slider(minimum=0, maximum=2, value=1, step=0.1, label="Temperature")
155
+ max_tokens = gr.Slider(minimum=1, maximum=4096, value=1000, step=1, label="Max Tokens")
156
+ top_p = gr.Slider(minimum=0, maximum=1, value=1, step=0.01, label="Top P")
157
+ frequency_penalty = gr.Slider(minimum=-2, maximum=2, value=0, step=0.1, label="Frequency Penalty")
158
+
159
  with gr.Accordion("Advanced Settings", open=False):
160
+ with gr.Group():
161
+ top_k = gr.Slider(minimum=0, maximum=100, value=0, step=1, label="Top K")
162
+ presence_penalty = gr.Slider(minimum=-2, maximum=2, value=0, step=0.1, label="Presence Penalty")
163
+ repetition_penalty = gr.Slider(minimum=0, maximum=2, value=1, step=0.1, label="Repetition Penalty")
164
+ stop = gr.Textbox(label="Stop Sequence")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
 
166
+ with gr.Group():
167
+ min_p = gr.Slider(minimum=0, maximum=1, value=0, step=0.01, label="Min P")
168
+ top_a = gr.Slider(minimum=0, maximum=1, value=0, step=0.01, label="Top A")
169
+ seed = gr.Number(label="Seed", precision=0)
170
+ logit_bias = gr.Textbox(label="Logit Bias (JSON)")
171
+ logprobs = gr.Checkbox(label="Log Probabilities")
172
+ top_logprobs = gr.Slider(minimum=0, maximum=20, value=0, step=1, label="Top Log Probabilities")
173
+ response_format = gr.Textbox(label="Response Format (JSON)")
174
+ tools = gr.Textbox(label="Tools (JSON Array)")
175
+ tool_choice = gr.Textbox(label="Tool Choice")
176
 
177
  with gr.Column(scale=2):
178
  chatbot = gr.ChatInterface(