rngzhi commited on
Commit
1be195c
1 Parent(s): 3bd453a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -1,3 +1,4 @@
 
1
  import gradio as gr
2
  from transformers import pipeline
3
 
@@ -5,6 +6,8 @@ MODEL_NAME = "rngzhi/cs3264-project"
5
  BATCH_SIZE = 8
6
  FILE_LIMIT_MB = 1000
7
 
 
 
8
  pipe = pipeline(
9
  task="automatic-speech-recognition",
10
  model=MODEL_NAME,
 
1
+ import torch
2
  import gradio as gr
3
  from transformers import pipeline
4
 
 
6
  BATCH_SIZE = 8
7
  FILE_LIMIT_MB = 1000
8
 
9
+ device = 0 if torch.cuda.is_available() else "cpu"
10
+
11
  pipe = pipeline(
12
  task="automatic-speech-recognition",
13
  model=MODEL_NAME,