Spaces:
Sleeping
Sleeping
from fastapi import FastAPI | |
app = FastAPI() | |
def greet_json(): | |
return {"Hello": "World!"} | |
#----------------------------------------------------------------------------------------- | |
import os | |
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2" | |
os.environ["MPLCONFIGDIR"] = "/tmp/matplotlib" | |
os.environ["FONTCONFIG_PATH"] = "/tmp/fontconfig" | |
os.environ["HF_HOME"] = "/tmp/huggingface_cache" | |
os.makedirs("/tmp/matplotlib", exist_ok=True) | |
os.makedirs("/tmp/fontconfig", exist_ok=True) | |
os.makedirs("/tmp/huggingface_cache", exist_ok=True) | |
from torchaudio.pipelines import WAV2VEC2_BASE | |
bundle = WAV2VEC2_BASE | |
model = bundle.get_model() | |
print("Model downloaded successfully!") | |
#----------------------------------------------------------------------------------------- |