akhaliq HF staff commited on
Commit
04085ad
·
1 Parent(s): fe69f1a
Files changed (1) hide show
  1. utils.py +5 -1
utils.py CHANGED
@@ -33,7 +33,11 @@ def get_app(
33
  # Handle the case where block is a function by passing the model name
34
  block(name=model_name).render()
35
  else:
36
- gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs)
 
 
 
 
37
  columns.append(column)
38
 
39
  model.change(
 
33
  # Handle the case where block is a function by passing the model name
34
  block(name=model_name).render()
35
  else:
36
+ # If src is a function, call it directly with the model name
37
+ if callable(src):
38
+ src(model_name, accept_token).render()
39
+ else:
40
+ gr.load(name=model_name, src=src, accept_token=accept_token, **kwargs)
41
  columns.append(column)
42
 
43
  model.change(