When I rebuild a T4 GPU docker my URL keeps changing to indicate the replica. E.g.:
https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/y35z0/
When I call the gradio app as API I would like to make the consumer impervious to a change in URL.
Will it work if I donât include replica in the URL. e.g.
https://awacke1-speech-recognition-canary-nvidiat4.hf.space/ ?
My calling code uses the URL as follows:
def transcribeWavtoTxt(filename):
from gradio_client import Client
with open(filename, ârbâ) as f:
data = f.read()
url=âhttps://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/4j9xb/â
client = Client(url)
#old URL from last build --- client = Client("https://awacke1-speech-recognition-canary-nvidiat4.hf.space/--replicas/0wdf4/")
result = client.predict(
filename,
"English", # Literal['English', 'Spanish', 'French', 'German'] in 'Input audio is spoken in:' Dropdown component
"English", # Literal['English', 'Spanish', 'French', 'German'] in 'Transcribe in language:' Dropdown component
True, # bool in 'Punctuation & Capitalization in transcript?' Checkbox component
api_name="/transcribe"
)
return result