Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import whisper
|
2 |
import torch
|
3 |
from transformers import pipeline
|
4 |
from transformers.utils import logging
|
5 |
from langdetect import detect
|
6 |
import gradio as gr
|
7 |
-
import os
|
8 |
from gtts import gTTS
|
9 |
from moviepy.editor import VideoFileClip
|
10 |
import yt_dlp
|
11 |
|
|
|
12 |
# Set logging verbosity
|
13 |
logging.set_verbosity_error()
|
14 |
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
# Check if the question_generation directory exists; if not, clone the repository
|
5 |
+
if not os.path.exists("question_generation"):
|
6 |
+
subprocess.call(["git", "clone", "https://github.com/patil-suraj/question_generation.git"])
|
7 |
+
|
8 |
+
# Download necessary files using wget (if needed)
|
9 |
+
import wget
|
10 |
+
|
11 |
+
!wget --no-check-certificate -O video-example.mp4 "https://drive.google.com/uc?export=download&id=1o6hO2tYTxgudQSwhSD1E0wVwZ_N6qR1l"
|
12 |
+
!wget --no-check-certificate -O audio-example.mp3 "https://drive.google.com/uc?export=download&id=1BcE0aITKjABWcN6JFs5lS1GFUjCQU_7Y"
|
13 |
+
|
14 |
+
# Continue with the rest of your imports and app logic
|
15 |
import whisper
|
16 |
import torch
|
17 |
from transformers import pipeline
|
18 |
from transformers.utils import logging
|
19 |
from langdetect import detect
|
20 |
import gradio as gr
|
|
|
21 |
from gtts import gTTS
|
22 |
from moviepy.editor import VideoFileClip
|
23 |
import yt_dlp
|
24 |
|
25 |
+
|
26 |
# Set logging verbosity
|
27 |
logging.set_verbosity_error()
|
28 |
|