Spaces:
Runtime error
Runtime error
Commit
·
6430135
1
Parent(s):
e2aa713
fix main
Browse files
app.py
CHANGED
|
@@ -9,6 +9,9 @@ import shutil
|
|
| 9 |
if not shutil.which("ffmpeg"):
|
| 10 |
raise EnvironmentError("ffmpeg not found. Please install ffmpeg and ensure it's in PATH.")
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
# ✅ โหลดโมเดล
|
| 13 |
MODEL_NAME = "biodatlab/whisper-th-small-combined"
|
| 14 |
device = 0 if torch.cuda.is_available() else "cpu"
|
|
@@ -73,4 +76,4 @@ with gr.Blocks() as demo:
|
|
| 73 |
download_button.click(fn=get_download_filepath, inputs=download_button, outputs=download_button)
|
| 74 |
|
| 75 |
# รันใน Hugging Face Spaces ด้วย auth
|
| 76 |
-
demo.launch(
|
|
|
|
| 9 |
if not shutil.which("ffmpeg"):
|
| 10 |
raise EnvironmentError("ffmpeg not found. Please install ffmpeg and ensure it's in PATH.")
|
| 11 |
|
| 12 |
+
# ✅ ลบ path ffmpeg เฉพาะ local เพราะ Spaces มี ffmpeg ติดตั้งแล้ว
|
| 13 |
+
# os.environ["PATH"] += os.pathsep + r"C:\ffmpeg\ffmpeg-master-latest-win64-gpl\ffmpeg-master-latest-win64-gpl\bin"
|
| 14 |
+
|
| 15 |
# ✅ โหลดโมเดล
|
| 16 |
MODEL_NAME = "biodatlab/whisper-th-small-combined"
|
| 17 |
device = 0 if torch.cuda.is_available() else "cpu"
|
|
|
|
| 76 |
download_button.click(fn=get_download_filepath, inputs=download_button, outputs=download_button)
|
| 77 |
|
| 78 |
# รันใน Hugging Face Spaces ด้วย auth
|
| 79 |
+
demo.launch()
|