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) | |
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 | |