Update app.py
Browse files
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()}
|
| 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
|
| 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:
|