1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109
| ---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
Cell In [24], line 1
----> 1 out = model.transcribe('speech-en.mp3')
2 out
File ~\_NLP_Whisper-OpenAI\whisper10py3106venv\lib\site-packages\whisper\transcribe.py:84, in transcribe(model, audio, verbose, temperature, compression_ratio_threshold, logprob_threshold, no_speech_threshold, condition_on_previous_text, **decode_options)
81 if dtype == torch.float32:
82 decode_options["fp16"] = False
---> 84 mel = log_mel_spectrogram(audio)
86 if decode_options.get("language", None) is None:
87 if not model.is_multilingual:
File ~\_NLP_Whisper-OpenAI\whisper10py3106venv\lib\site-packages\whisper\audio.py:111, in log_mel_spectrogram(audio, n_mels)
109 if not torch.is_tensor(audio):
110 if isinstance(audio, str):
--> 111 audio = load_audio(audio)
112 audio = torch.from_numpy(audio)
114 window = torch.hann_window(N_FFT).to(audio.device)
File ~\_NLP_Whisper-OpenAI\whisper10py3106venv\lib\site-packages\whisper\audio.py:42, in load_audio(file, sr)
23 """
24 Open an audio file and read as mono waveform, resampling as necessary
25
(...)
36 A NumPy array containing the audio waveform, in float32 dtype.
37 """
38 try:
39 # This launches a subprocess to decode audio while down-mixing and resampling as necessary.
40 # Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
41 out, _ = (
---> 42 ffmpeg.input(file, threads=0)
43 .output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=sr)
44 .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
45 )
46 except ffmpeg.Error as e:
47 raise RuntimeError(f"Failed to load audio: {e.stderr.decode()}") from e
File ~\_NLP_Whisper-OpenAI\whisper10py3106venv\lib\site-packages\ffmpeg\_run.py:313, in run(stream_spec, cmd, capture_stdout, capture_stderr, input, quiet, overwrite_output)
289 @output_operator()
290 def run(
291 stream_spec,
(...)
297 overwrite_output=False,
298 ):
299 """Invoke ffmpeg for the supplied node graph.
300
301 Args:
(...)
311 Returns: (out, err) tuple containing captured stdout and stderr data.
312 """
--> 313 process = run_async(
314 stream_spec,
315 cmd,
316 pipe_stdin=input is not None,
317 pipe_stdout=capture_stdout,
318 pipe_stderr=capture_stderr,
319 quiet=quiet,
320 overwrite_output=overwrite_output,
321 )
322 out, err = process.communicate(input)
323 retcode = process.poll()
File ~\_NLP_Whisper-OpenAI\whisper10py3106venv\lib\site-packages\ffmpeg\_run.py:284, in run_async(stream_spec, cmd, pipe_stdin, pipe_stdout, pipe_stderr, quiet, overwrite_output)
282 stdout_stream = subprocess.PIPE if pipe_stdout or quiet else None
283 stderr_stream = subprocess.PIPE if pipe_stderr or quiet else None
--> 284 return subprocess.Popen(
285 args, stdin=stdin_stream, stdout=stdout_stream, stderr=stderr_stream
286 )
File ~\anaconda3\envs\py3106\lib\subprocess.py:969, in Popen.__init__(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags, restore_signals, start_new_session, pass_fds, user, group, extra_groups, encoding, errors, text, umask, pipesize)
965 if self.text_mode:
966 self.stderr = io.TextIOWrapper(self.stderr,
967 encoding=encoding, errors=errors)
--> 969 self._execute_child(args, executable, preexec_fn, close_fds,
970 pass_fds, cwd, env,
971 startupinfo, creationflags, shell,
972 p2cread, p2cwrite,
973 c2pread, c2pwrite,
974 errread, errwrite,
975 restore_signals,
976 gid, gids, uid, umask,
977 start_new_session)
978 except:
979 # Cleanup if the child failed starting.
980 for f in filter(None, (self.stdin, self.stdout, self.stderr)):
File ~\anaconda3\envs\py3106\lib\subprocess.py:1438, in Popen._execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, unused_restore_signals, unused_gid, unused_gids, unused_uid, unused_umask, unused_start_new_session)
1436 # Start the process
1437 try:
-> 1438 hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
1439 # no special security
1440 None, None,
1441 int(not close_fds),
1442 creationflags,
1443 env,
1444 cwd,
1445 startupinfo)
1446 finally:
1447 # Child is launched. Close the parent's copy of those pipe
1448 # handles that only the child should have open. You need
(...)
1451 # pipe will not close when the child process exits and the
1452 # ReadFile will hang.
1453 self._close_pipe_fds(p2cread, p2cwrite,
1454 c2pread, c2pwrite,
1455 errread, errwrite)
FileNotFoundError: [WinError 2] Le fichier spécifié est introuvable |
Partager