Tonic commited on
Commit
39cd40f
·
1 Parent(s): 6d82e2e

improves interface with layout html

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -259,7 +259,7 @@ def generate_response(input_data, chat_history, max_new_tokens, model_identity,
259
  yield f"❌ Error during generation: {e}"
260
 
261
  APP_CSS = """
262
- #main_chatbot {height: calc(100vh - 220px);}
263
  .gradio-container {min-height: 100vh;}
264
  """
265
 
@@ -285,35 +285,35 @@ demo = gr.ChatInterface(
285
  additional_inputs=[
286
  gr.Slider(label="Max new tokens", minimum=64, maximum=4096, step=1, value=2048),
287
  gr.Textbox(
288
- label="Model Identity",
289
  value=MODEL_IDENTITY,
290
- lines=3,
291
  placeholder="Optional identity/persona for the model"
292
  ),
293
  gr.Textbox(
294
- label="System Prompt",
295
  value=DEFAULT_SYSTEM_PROMPT,
296
- lines=4,
297
  placeholder="Change system prompt"
298
  ),
299
  gr.Textbox(
300
- label="Developer Prompt",
301
  value=DEFAULT_DEVELOPER_PROMPT,
302
- lines=4,
303
  placeholder="Optional developer instructions"
304
  ),
305
  gr.Dropdown(
306
- label="Reasoning Effort",
307
  choices=["low", "medium", "high"],
308
  value=DEFAULT_REASONING_EFFORT,
309
  interactive=True,
310
  ),
311
- gr.Slider(label="Temperature", minimum=0.1, maximum=2.0, step=0.1, value=0.7),
312
- gr.Slider(label="Top-p", minimum=0.05, maximum=1.0, step=0.05, value=0.9),
313
- gr.Slider(label="Top-k", minimum=1, maximum=100, step=1, value=50),
314
- gr.Slider(label="Repetition Penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.0),
315
  ],
316
- additional_inputs_accordion="Additional Parameters",
317
  examples=[
318
  [{"text": "A 68-year-old man complains of several blisters arising over the back and trunk for the preceding 2 weeks. He takes no medications and has not noted systemic symptoms such as fever, sore throat, weight loss, or fatigue. The general physical examination is normal. The oral mucosa and the lips are normal. Several 2- to 3-cm bullae are present over the trunk and back. A few excoriations where the blisters have ruptured are present. The remainder of the skin is normal, without erythema or scale. What is the best diagnostic approach at this time?"}],
319
  [{"text": "A 28-year-old woman, gravida 2, para 1, at 40 weeks of gestation is admitted to the hospital in active labor. The patient has attended many prenatal appointments and followed her physician's advice about screening for diseases, laboratory testing, diet, and exercise. Her pregnancy has been uncomplicated. She has no history of a serious illness. Her first child was delivered via normal vaginal delivery. Her vital signs are within normal limits. Cervical examination shows 100% effacement and 10 cm dilation. A cardiotocograph is shown. Which of the following is the most appropriate initial step in management?"}],
 
259
  yield f"❌ Error during generation: {e}"
260
 
261
  APP_CSS = """
262
+ #main_chatbot {height: calc(100vh - 120px);} /* Increase chatbot viewport height */
263
  .gradio-container {min-height: 100vh;}
264
  """
265
 
 
285
  additional_inputs=[
286
  gr.Slider(label="Max new tokens", minimum=64, maximum=4096, step=1, value=2048),
287
  gr.Textbox(
288
+ label="🪪Model Identity",
289
  value=MODEL_IDENTITY,
290
+ lines=1,
291
  placeholder="Optional identity/persona for the model"
292
  ),
293
  gr.Textbox(
294
+ label="🤖System Prompt",
295
  value=DEFAULT_SYSTEM_PROMPT,
296
+ lines=1,
297
  placeholder="Change system prompt"
298
  ),
299
  gr.Textbox(
300
+ label="👨🏻‍💻Developer Prompt",
301
  value=DEFAULT_DEVELOPER_PROMPT,
302
+ lines=1,
303
  placeholder="Optional developer instructions"
304
  ),
305
  gr.Dropdown(
306
+ label="🧠Reasoning Effort",
307
  choices=["low", "medium", "high"],
308
  value=DEFAULT_REASONING_EFFORT,
309
  interactive=True,
310
  ),
311
+ gr.Slider(label="🌡️Temperature", minimum=0.1, maximum=2.0, step=0.1, value=0.7),
312
+ gr.Slider(label="↗️Top-p", minimum=0.05, maximum=1.0, step=0.05, value=0.9),
313
+ gr.Slider(label="🔝Top-k", minimum=1, maximum=100, step=1, value=50),
314
+ gr.Slider(label="🦜Repetition Penalty", minimum=1.0, maximum=2.0, step=0.05, value=1.0),
315
  ],
316
+ additional_inputs_accordion=gr.Accordion(label="🔧Advanced Inputs", open=False),
317
  examples=[
318
  [{"text": "A 68-year-old man complains of several blisters arising over the back and trunk for the preceding 2 weeks. He takes no medications and has not noted systemic symptoms such as fever, sore throat, weight loss, or fatigue. The general physical examination is normal. The oral mucosa and the lips are normal. Several 2- to 3-cm bullae are present over the trunk and back. A few excoriations where the blisters have ruptured are present. The remainder of the skin is normal, without erythema or scale. What is the best diagnostic approach at this time?"}],
319
  [{"text": "A 28-year-old woman, gravida 2, para 1, at 40 weeks of gestation is admitted to the hospital in active labor. The patient has attended many prenatal appointments and followed her physician's advice about screening for diseases, laboratory testing, diet, and exercise. Her pregnancy has been uncomplicated. She has no history of a serious illness. Her first child was delivered via normal vaginal delivery. Her vital signs are within normal limits. Cervical examination shows 100% effacement and 10 cm dilation. A cardiotocograph is shown. Which of the following is the most appropriate initial step in management?"}],