Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,8 @@
|
|
1 |
import subprocess
|
2 |
import sys
|
3 |
|
4 |
-
# β
|
5 |
-
|
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
|
@@ -14,12 +10,14 @@ 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
|
20 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
21 |
from sentence_transformers import SentenceTransformer, util
|
22 |
|
|
|
23 |
# β
Suppress Warnings
|
24 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
25 |
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
|
|
|
1 |
import subprocess
|
2 |
import sys
|
3 |
|
4 |
+
# β
Force install moviepy before imports
|
5 |
+
subprocess.run([sys.executable, "-m", "pip", "install", "--no-cache-dir", "moviepy", "imageio[ffmpeg]"])
|
|
|
|
|
|
|
|
|
6 |
|
7 |
import os
|
8 |
import io
|
|
|
10 |
import uvicorn
|
11 |
import spacy
|
12 |
import pdfplumber
|
13 |
+
import moviepy.editor as mp # Now it will be installed before this line
|
14 |
import librosa
|
15 |
import soundfile as sf
|
16 |
from fastapi import FastAPI, UploadFile, File, HTTPException
|
17 |
from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
18 |
from sentence_transformers import SentenceTransformer, util
|
19 |
|
20 |
+
|
21 |
# β
Suppress Warnings
|
22 |
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
23 |
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
|