englissi commited on
Commit
8dd10aa
ยท
verified ยท
1 Parent(s): b4e6fbc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -6
app.py CHANGED
@@ -1,10 +1,13 @@
1
  import gradio as gr
2
- import torch
3
- from transformers import pipeline
4
-
5
-
6
  import os
 
 
 
7
  os.system("pip install torch")
 
 
 
 
8
 
9
  # Initialize the ASR pipeline for Bulgarian
10
  asr_pipeline = pipeline("automatic-speech-recognition", model="infinitejoy/wav2vec2-large-xls-r-300m-bulgarian")
@@ -26,5 +29,4 @@ iface = gr.Interface(
26
 
27
  # ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
28
  if __name__ == "__main__":
29
- iface.launch()
30
-
 
1
  import gradio as gr
 
 
 
 
2
  import os
3
+ import time # To add a short delay
4
+
5
+ # Force install torch (though this should ideally be handled in requirements.txt)
6
  os.system("pip install torch")
7
+ time.sleep(10) # Adding a short delay to ensure installation completes
8
+
9
+ import torch
10
+ from transformers import pipeline
11
 
12
  # Initialize the ASR pipeline for Bulgarian
13
  asr_pipeline = pipeline("automatic-speech-recognition", model="infinitejoy/wav2vec2-large-xls-r-300m-bulgarian")
 
29
 
30
  # ์ธํ„ฐํŽ˜์ด์Šค ์‹คํ–‰
31
  if __name__ == "__main__":
32
+ iface.launch()