ferhatbou commited on
Commit
6bced3b
·
1 Parent(s): 0292df6

Fix import issue

Browse files
Files changed (3) hide show
  1. app.py +0 -18
  2. requirements.txt +12 -10
  3. video_accent_analyzer.py +9 -1
app.py CHANGED
@@ -153,24 +153,6 @@ with gr.Blocks(css=css) as interface:
153
  label="Example Videos"
154
  )
155
 
156
- # Add requirements.txt
157
- requirements = """
158
- gradio>=4.0.0
159
- plotly>=5.0.0
160
- yt-dlp
161
- librosa
162
- soundfile
163
- transformers
164
- torch
165
- ffmpeg-python
166
- matplotlib
167
- seaborn
168
- pandas
169
- ipython
170
- """
171
-
172
- with open("requirements.txt", "w") as f:
173
- f.write(requirements)
174
 
175
  if __name__ == "__main__":
176
  interface.launch()
 
153
  label="Example Videos"
154
  )
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
 
157
  if __name__ == "__main__":
158
  interface.launch()
requirements.txt CHANGED
@@ -1,10 +1,12 @@
1
- gradio>=4.0.0
2
- plotly>=5.0.0
3
- yt-dlp
4
- librosa
5
- soundfile
6
- transformers
7
- torch
8
- ffmpeg-python
9
- matplotlib
10
- seaborn
 
 
 
1
+ gradio>=4.0.0
2
+ plotly>=5.0.0
3
+ yt-dlp
4
+ librosa
5
+ soundfile
6
+ transformers
7
+ torch
8
+ ffmpeg-python
9
+ matplotlib
10
+ seaborn
11
+ pandas
12
+ ipython
video_accent_analyzer.py CHANGED
@@ -14,10 +14,18 @@ import warnings
14
  import time
15
  from pathlib import Path
16
  from urllib.parse import urlparse
17
- from IPython.display import display, HTML, Audio
18
  import pandas as pd
19
  import matplotlib.pyplot as plt
20
  import seaborn as sns
 
 
 
 
 
 
 
 
 
21
 
22
  # Suppress warnings for cleaner output
23
  warnings.filterwarnings('ignore')
 
14
  import time
15
  from pathlib import Path
16
  from urllib.parse import urlparse
 
17
  import pandas as pd
18
  import matplotlib.pyplot as plt
19
  import seaborn as sns
20
+ try:
21
+ from IPython.display import display, HTML, Audio
22
+ IPYTHON_AVAILABLE = True
23
+ except ImportError:
24
+ IPYTHON_AVAILABLE = False
25
+ # Create dummy display functions
26
+ def display(*args, **kwargs): pass
27
+ def HTML(*args, **kwargs): pass
28
+ def Audio(*args, **kwargs): pass
29
 
30
  # Suppress warnings for cleaner output
31
  warnings.filterwarnings('ignore')