|
import gradio as gr |
|
from transformers import pipeline |
|
import requests |
|
import json |
|
|
|
def greet(sentences1): |
|
|
|
API_URL = "https://api-inference.huggingface.co/models/openai/whisper-large-v3-turbo" |
|
headers = {"Authorization": "Bearer hf_api_key"} |
|
|
|
def query(filename): |
|
with open(filename, "rb") as f: |
|
data = f.read() |
|
response = requests.post(API_URL, headers=headers, data=data) |
|
return response.json() |
|
|
|
my_text = query("rawveg7.mp3") |
|
|
|
sentences = my_text["text"].split(".") |
|
|
|
return my_text |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
demo = gr.Interface(fn=greet, inputs="file", outputs="text") |
|
demo.launch() |