import gradio as gr # Use a pipeline as a high-level helper from transformers import pipeline # pipe = pipeline("zero-shot-image-classification", model="google/siglip-base-patch16-256-multilingual") # gr.load("models/wisdomik/QuiltNet-B-16").launch() # gr.load("models/google/siglip-base-patch16-256-multilingual").launch() # gr.Interface.from_pipeline(pipe).launch() classifier = pipeline(model="google/siglip-so400m-patch14-384") result = classifier( "https://huggingface.co/datasets/Narsil/image_dummy/raw/main/parrots.png", candidate_labels=["animals", "humans", "landscape"], ) print(result) def greet(name, candidate_labels): print(type(candidate_labels)) return "Hello " + name + "!!" + candidate_labels demo = gr.Interface(fn=greet, inputs=["text","text"], outputs="text") demo.queue(api_open=True).launch()