Spaces:
Runtime error
Runtime error
File size: 1,048 Bytes
ced8109 a66ca6d ced8109 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#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()
|