chuuhtetnaing commited on
Commit
b4bb62b
1 Parent(s): adbdc09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,5 @@
1
  import spaces
2
-
3
  import gradio as gr
4
  import yt_dlp as youtube_dl
5
  from transformers import pipeline
@@ -13,7 +13,7 @@ BATCH_SIZE = 8
13
  FILE_LIMIT_MB = 1000
14
  YT_LENGTH_LIMIT_S = 3600 # limit to 1 hour YouTube files
15
 
16
- device = 0
17
 
18
  pipe = pipeline(
19
  task="automatic-speech-recognition",
 
1
  import spaces
2
+ import torch
3
  import gradio as gr
4
  import yt_dlp as youtube_dl
5
  from transformers import pipeline
 
13
  FILE_LIMIT_MB = 1000
14
  YT_LENGTH_LIMIT_S = 3600 # limit to 1 hour YouTube files
15
 
16
+ device = 0 if torch.cuda.is_available() else "cpu"
17
 
18
  pipe = pipeline(
19
  task="automatic-speech-recognition",