satyamr196 commited on
Commit
2f5d98f
·
1 Parent(s): e02ab90

update output_dir = data instead of /data which was wrong and removed GPU available check because transformer library automatically uses GPU if available

Browse files
Files changed (1) hide show
  1. ASR_Server.py +11 -11
ASR_Server.py CHANGED
@@ -13,8 +13,8 @@ job_status = {
13
  "completed": 0,
14
  "message": "No job running"
15
  }
16
- csv_path = "test.csv"
17
- output_dir="/data"
18
  df = pd.read_csv(csv_path)
19
  print(f"CSV Loaded with {len(df)} rows")
20
 
@@ -53,17 +53,17 @@ def generateTranscript(ASR_model):
53
  total = len(df)
54
  job_status["total"] = total
55
 
56
- import torch
57
- # Check if GPU is available
58
- if torch.cuda.is_available():
59
- device = 0
60
- print("Device set to use GPU")
61
- else:
62
- device = -1
63
- print("Device set to use CPU")
64
 
65
  # Initialize ASR pipeline
66
- pipe = pipeline("automatic-speech-recognition", model=ASR_model, device=device)
67
 
68
  # Column with filenames in the CSV
69
  filename_column = df.columns[0]
 
13
  "completed": 0,
14
  "message": "No job running"
15
  }
16
+ csv_path = "test.csv"
17
+ output_dir="data"
18
  df = pd.read_csv(csv_path)
19
  print(f"CSV Loaded with {len(df)} rows")
20
 
 
53
  total = len(df)
54
  job_status["total"] = total
55
 
56
+ # import torch
57
+ # # Check if GPU is available
58
+ # if torch.cuda.is_available():
59
+ # device = 0
60
+ # print("Device set to use GPU")
61
+ # else:
62
+ # device = -1
63
+ # print("Device set to use CPU")
64
 
65
  # Initialize ASR pipeline
66
+ pipe = pipeline("automatic-speech-recognition", model=ASR_model)
67
 
68
  # Column with filenames in the CSV
69
  filename_column = df.columns[0]