archit11 commited on
Commit
74c1f5d
1 Parent(s): b3a7843

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,7 +15,7 @@ class YouTubeTranscriber:
15
  self.model = WhisperModel(model_path)
16
 
17
  def download_audio(self, url: str, preferred_quality: str = "192") -> str:
18
- file_name = f"{uuid.uuid4()}.mp3"
19
  output_path = os.path.join("/tmp", file_name) # Use /tmp directory for temporary storage
20
 
21
  ydl_opts = {
@@ -45,7 +45,7 @@ class YouTubeTranscriber:
45
 
46
  def transcribe_audio(self, path: str) -> Generator:
47
  print(f"Reading {path}")
48
- segments, _ = self.model.transcribe(path+".mp3")
49
  return segments
50
 
51
  def process_segments(self, segments: Generator) -> pd.DataFrame:
 
15
  self.model = WhisperModel(model_path)
16
 
17
  def download_audio(self, url: str, preferred_quality: str = "192") -> str:
18
+ file_name = f"{uuid.uuid4()}"
19
  output_path = os.path.join("/tmp", file_name) # Use /tmp directory for temporary storage
20
 
21
  ydl_opts = {
 
45
 
46
  def transcribe_audio(self, path: str) -> Generator:
47
  print(f"Reading {path}")
48
+ segments, _ = self.model.transcribe(path)
49
  return segments
50
 
51
  def process_segments(self, segments: Generator) -> pd.DataFrame: