gbyuvd commited on
Commit
26a5cc7
Β·
verified Β·
1 Parent(s): 34887f1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -331,6 +331,14 @@ def create_simple_interface():
331
  )
332
  load_btn = gr.Button("πŸ” Load Selected Model", variant="secondary")
333
 
 
 
 
 
 
 
 
 
334
  # Generation controls
335
  with gr.Row():
336
  with gr.Column():
@@ -369,22 +377,18 @@ def create_simple_interface():
369
  interactive=False
370
  )
371
 
372
- # Load model on button click
373
- load_status = gr.Textbox(label="Model Status", interactive=False, visible=False)
374
-
375
  def load_model_wrapper(model_name):
376
  success = app.load_model_by_name(model_name)
377
- status = "βœ… Model loaded successfully!" if success else "❌ Failed to load model"
 
 
 
378
  return status
379
 
380
  load_btn.click(
381
  fn=load_model_wrapper,
382
  inputs=model_choice,
383
- outputs=load_status
384
- ).then(
385
- fn=lambda: gr.update(visible=True),
386
- inputs=None,
387
- outputs=load_status
388
  )
389
 
390
  # Generate molecule
 
331
  )
332
  load_btn = gr.Button("πŸ” Load Selected Model", variant="secondary")
333
 
334
+ # Model status indicator
335
+ model_status = gr.Textbox(
336
+ label="Model Status",
337
+ value=f"βœ… Current Model: {default_model}",
338
+ interactive=False,
339
+ show_copy_button=True
340
+ )
341
+
342
  # Generation controls
343
  with gr.Row():
344
  with gr.Column():
 
377
  interactive=False
378
  )
379
 
 
 
 
380
  def load_model_wrapper(model_name):
381
  success = app.load_model_by_name(model_name)
382
+ if success:
383
+ status = f"βœ… Current Model: {model_name} (Ready to use!)"
384
+ else:
385
+ status = f"❌ Failed to load: {model_name}"
386
  return status
387
 
388
  load_btn.click(
389
  fn=load_model_wrapper,
390
  inputs=model_choice,
391
+ outputs=model_status
 
 
 
 
392
  )
393
 
394
  # Generate molecule