summary / hf.py
xsestech's picture
Created app
d5c679f verified
raw
history blame contribute delete
530 Bytes
from gradio_client import Client, handle_file
from loguru import logger
from rate_limit import rate_limit_bypass
def get_whisper_hf_client() -> Client:
API_URL = "sanchit-gandhi/whisper-jax-spaces"
return Client(API_URL)
@rate_limit_bypass(sleep_time=2)
def hf_transcript(client: Client, audio_path: str):
text, runtime = client.predict(
inputs=handle_file(audio_path),
task="transcribe",
return_timestamps=False,
api_name="/predict_1",
)
logger.info(text)
return text