Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,21 @@ demo = gr.Interface(
|
|
| 17 |
|
| 18 |
demo.launch()
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
| 22 |
import torch
|
|
@@ -45,3 +60,4 @@ predicted_ids = model.generate(input_features)
|
|
| 45 |
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
|
| 46 |
print(transcription)
|
| 47 |
|
|
|
|
|
|
| 17 |
|
| 18 |
demo.launch()
|
| 19 |
|
| 20 |
+
from pytube import YouTube
|
| 21 |
+
|
| 22 |
+
# YouTube video ki link yahan daalein
|
| 23 |
+
video_url = "https://www.youtube.com/watch?v=YOUR_VIDEO_ID"
|
| 24 |
+
|
| 25 |
+
# YouTube object banayein
|
| 26 |
+
yt = YouTube(video_url)
|
| 27 |
+
|
| 28 |
+
# Highest resolution wali stream select karein
|
| 29 |
+
stream = yt.streams.get_highest_resolution()
|
| 30 |
+
|
| 31 |
+
# Video download karein (default folder mein)
|
| 32 |
+
stream.download()
|
| 33 |
+
|
| 34 |
+
print("Video download ho gaya:", yt.title)
|
| 35 |
|
| 36 |
from transformers import WhisperProcessor, WhisperForConditionalGeneration
|
| 37 |
import torch
|
|
|
|
| 60 |
transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
|
| 61 |
print(transcription)
|
| 62 |
|
| 63 |
+
|