xnetba commited on
Commit
d8ff54c
·
1 Parent(s): e3b015a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -20,21 +20,20 @@ model_list = [
20
  ]
21
 
22
  default_model = "stabilityai/stable-diffusion-2"
23
- model_name = gr.inputs.Dropdown(model_list, label="Select Model", default=default_model)
24
  model = None
25
 
26
  def load_model(model_name):
27
  global model
28
- model = gr.Interface.load(model_name, api_key=api_key)
29
 
30
  def predict(inputs):
31
  return model.predict(inputs)
32
 
33
  iface = gr.Interface(
34
  fn=predict,
35
- inputs=model,
36
  outputs="text",
37
- capture_session=True,
38
  title="Model Selection App",
39
  description="Choose a model and input data to make predictions."
40
  )
 
20
  ]
21
 
22
  default_model = "stabilityai/stable-diffusion-2"
23
+ model_name = gr.outputs.Dropdown(model_list, label="Select Model", default=default_model)
24
  model = None
25
 
26
  def load_model(model_name):
27
  global model
28
+ model = gr.load(model_name, api_key=api_key)
29
 
30
  def predict(inputs):
31
  return model.predict(inputs)
32
 
33
  iface = gr.Interface(
34
  fn=predict,
35
+ inputs=model_name,
36
  outputs="text",
 
37
  title="Model Selection App",
38
  description="Choose a model and input data to make predictions."
39
  )