from transformers import pipeline import gradio as gr from huggingface_hub import HfFolder token = HfFolder.get_token() pipe = pipeline(model="SaladSlayer00/another_local", token='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') def transcribe(rec=None, file=None): if rec is not None: audio = rec elif file is not None: audio = file else: return "Provide a recording or a file." text = pipe(audio)["text"] return text iface = gr.Interface( fn=transcribe, inputs=[ gr.Audio(type="filepath") ], outputs="text", title="Whisper Small Italian", description="Realtime demo for Italian speech recognition using a fine-tuned Whisper model.", ) iface.launch()