Spaces:
Sleeping
Sleeping
GVAmaresh
commited on
Commit
·
453cd84
1
Parent(s):
c65986b
dev: check working
Browse files
app.py
CHANGED
|
@@ -4,4 +4,24 @@ app = FastAPI()
|
|
| 4 |
|
| 5 |
@app.get("/")
|
| 6 |
def greet_json():
|
| 7 |
-
return {"Hello": "World!"}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
@app.get("/")
|
| 6 |
def greet_json():
|
| 7 |
+
return {"Hello": "World!"}
|
| 8 |
+
|
| 9 |
+
#-----------------------------------------------------------------------------------------
|
| 10 |
+
|
| 11 |
+
import os
|
| 12 |
+
|
| 13 |
+
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "2"
|
| 14 |
+
os.environ["MPLCONFIGDIR"] = "/tmp/matplotlib"
|
| 15 |
+
os.environ["FONTCONFIG_PATH"] = "/tmp/fontconfig"
|
| 16 |
+
os.environ["HF_HOME"] = "/tmp/huggingface_cache"
|
| 17 |
+
|
| 18 |
+
os.makedirs("/tmp/matplotlib", exist_ok=True)
|
| 19 |
+
os.makedirs("/tmp/fontconfig", exist_ok=True)
|
| 20 |
+
os.makedirs("/tmp/huggingface_cache", exist_ok=True)
|
| 21 |
+
|
| 22 |
+
from torchaudio.pipelines import WAV2VEC2_BASE
|
| 23 |
+
bundle = WAV2VEC2_BASE
|
| 24 |
+
model = bundle.get_model()
|
| 25 |
+
print("Model downloaded successfully!")
|
| 26 |
+
|
| 27 |
+
#-----------------------------------------------------------------------------------------
|