Spaces:
Runtime error
Runtime error
#import gradio as gr | |
#gr.Interface.load("models/nota-ai/bk-sdm-small").launch() | |
import gradio as gr | |
# List of twenty animals and wildlife native to Minnesota | |
animals = [ | |
"White-tailed deer", "Moose", "Bobcat", "Coyote", "Red fox", | |
"Eastern gray squirrel", "American black bear", "Bald eagle", "Great horned owl", "Wild turkey", | |
"Canada goose", "Mallard duck", "Eastern bluebird", "Northern pike", "Walleye", | |
"Common loon", "Snowshoe hare", "Red-tailed hawk", "Beaver", "Eastern chipmunk" | |
] | |
def model_output(animal_name): | |
# Assuming the model accepts a string as input and returns some information about the animal | |
model = gr.Interface.load("models/nota-ai/bk-sdm-small") | |
return model(animal_name)[0] | |
interface = gr.Interface( | |
fn=model_output, # function to call on user input | |
inputs=gr.inputs.Dropdown(choices=animals, label="Select an Animal"), | |
outputs="text", | |
live=True # updates output without needing to click a button | |
) | |
interface.launch() | |