Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import io
|
3 |
import torch
|
4 |
import uvicorn
|
5 |
import spacy
|
6 |
import pdfplumber
|
7 |
-
import moviepy.editor as mp
|
8 |
import librosa
|
9 |
import soundfile as sf
|
10 |
from fastapi import FastAPI, UploadFile, File, HTTPException
|
|
|
1 |
+
import subprocess
|
2 |
+
import sys
|
3 |
+
|
4 |
+
# ✅ Ensure moviepy is installed at runtime
|
5 |
+
try:
|
6 |
+
import moviepy.editor as mp
|
7 |
+
except ImportError:
|
8 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "--no-cache-dir", "moviepy", "imageio[ffmpeg]"])
|
9 |
+
import moviepy.editor as mp # Try importing again
|
10 |
+
|
11 |
import os
|
12 |
import io
|
13 |
import torch
|
14 |
import uvicorn
|
15 |
import spacy
|
16 |
import pdfplumber
|
|
|
17 |
import librosa
|
18 |
import soundfile as sf
|
19 |
from fastapi import FastAPI, UploadFile, File, HTTPException
|