Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -28,14 +28,14 @@ def convert_to_wav(path):
|
|
28 |
segment = sound.subclip(0, int(sound.duration))
|
29 |
segment.write_audiofile(f"segment.wav")
|
30 |
|
31 |
-
return f"segment.wav"
|
32 |
|
33 |
def youtube_transcribe(url):
|
34 |
|
35 |
path = youtube_link(url)
|
36 |
-
path_wav = convert_to_wav(path)
|
37 |
|
38 |
-
audio_dataset = Dataset.from_dict({"audio": list(
|
39 |
text = pipe1(audio_dataset[0]["audio"])["text"]
|
40 |
|
41 |
return text
|
|
|
28 |
segment = sound.subclip(0, int(sound.duration))
|
29 |
segment.write_audiofile(f"segment.wav")
|
30 |
|
31 |
+
return f"segment.wav"os.path.join(os.getcwd(), 'segment.wav')
|
32 |
|
33 |
def youtube_transcribe(url):
|
34 |
|
35 |
path = youtube_link(url)
|
36 |
+
#path_wav = convert_to_wav(path)
|
37 |
|
38 |
+
audio_dataset = Dataset.from_dict({"audio": list(path)}).cast_column("audio", Audio(sampling_rate=16000))
|
39 |
text = pipe1(audio_dataset[0]["audio"])["text"]
|
40 |
|
41 |
return text
|