Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,42 +1,27 @@
|
|
| 1 |
import os
|
| 2 |
-
import
|
| 3 |
-
import sys
|
| 4 |
-
|
| 5 |
-
# Print Python environment info (optional, for logs)
|
| 6 |
-
print("Python executable:", sys.executable)
|
| 7 |
-
print("Python version:", sys.version)
|
| 8 |
-
|
| 9 |
-
try:
|
| 10 |
-
import moviepy
|
| 11 |
-
moviepy_path = os.path.dirname(moviepy.__file__)
|
| 12 |
-
print("moviepy path:", moviepy_path)
|
| 13 |
-
|
| 14 |
-
editor_path = os.path.join(moviepy_path, "editor.py")
|
| 15 |
-
editor_folder_path = os.path.join(moviepy_path, "editor")
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
| 19 |
|
| 20 |
-
except Exception as e:
|
| 21 |
-
print("Failed to import moviepy:", e)
|
| 22 |
-
|
| 23 |
-
# Force reinstall moviepy to fix possible incomplete install
|
| 24 |
try:
|
| 25 |
-
|
| 26 |
-
print("moviepy
|
| 27 |
except Exception as e:
|
| 28 |
-
print("Failed to
|
| 29 |
|
|
|
|
| 30 |
|
| 31 |
|
| 32 |
import whisper
|
| 33 |
-
from moviepy.editor import VideoFileClip
|
| 34 |
from transformers import pipeline
|
| 35 |
import nltk
|
| 36 |
#import os
|
| 37 |
import re
|
| 38 |
import random
|
| 39 |
-
|
| 40 |
from sklearn.feature_extraction.text import TfidfVectorizer
|
| 41 |
from sklearn.metrics.pairwise import cosine_similarity
|
| 42 |
from nltk.tokenize import sent_tokenize
|
|
|
|
| 1 |
import os
|
| 2 |
+
import moviepy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
moviepy_path = os.path.dirname(moviepy.__file__)
|
| 5 |
+
print("moviepy path:", moviepy_path)
|
| 6 |
+
print("Contents of moviepy package directory:", os.listdir(moviepy_path))
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
try:
|
| 9 |
+
import moviepy.editor
|
| 10 |
+
print("moviepy.editor imported successfully")
|
| 11 |
except Exception as e:
|
| 12 |
+
print("Failed to import moviepy.editor:", e)
|
| 13 |
|
| 14 |
+
from moviepy.editor import VideoFileClip
|
| 15 |
|
| 16 |
|
| 17 |
import whisper
|
| 18 |
+
#from moviepy.editor import VideoFileClip
|
| 19 |
from transformers import pipeline
|
| 20 |
import nltk
|
| 21 |
#import os
|
| 22 |
import re
|
| 23 |
import random
|
| 24 |
+
import subprocess
|
| 25 |
from sklearn.feature_extraction.text import TfidfVectorizer
|
| 26 |
from sklearn.metrics.pairwise import cosine_similarity
|
| 27 |
from nltk.tokenize import sent_tokenize
|