Somehow if I speak in other foreign languages, it crashes WhatsApp.
◇ [Transcription] Transcribing audio with "local" mode...
C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py:79: UserWarning: FP16 is not supported on CPU; using FP32 instead
warnings.warn("FP16 is not supported on CPU; using FP32 instead")
Traceback (most recent call last):
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\Scripts\whisper-script.py", line 33, in
sys.exit(load_entry_point('openai-whisper==20230124', 'console_scripts', 'whisper')())
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 314, in cli
result = transcribe(model, audio_path, temperature=temperature, **args)
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 230, in transcribe
add_segment(
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 170, in add_segment
print(make_safe(f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}"))
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 26-30: character maps to
node:internal/errors:867
const err = new Error(message);
^
Error: Command failed: whisper C:\Users\vcoop\AppData\Local\Temp\6fabd890-156c-475b-a2e2-9838a2c19884.wav
C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py:79: UserWarning: FP16 is not supported on CPU; using FP32 instead
warnings.warn("FP16 is not supported on CPU; using FP32 instead")
Traceback (most recent call last):
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\Scripts\whisper-script.py", line 33, in
sys.exit(load_entry_point('openai-whisper==20230124', 'console_scripts', 'whisper')())
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 314, in cli
result = transcribe(model, audio_path, temperature=temperature, **args)
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 230, in transcribe
add_segment(
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 170, in add_segment
print(make_safe(f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}"))
File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode characters in position 26-30: character maps to
at checkExecSyncError (node:child_process:885:11)
at Proxy.execSync (node:child_process:957:15)
at Module.transcribeAudioLocal (E:\OneDrive\Documents\GitHub\whatsapp-chatgpt\src\providers\whisper-local.ts:15:40)
at Module.handleIncomingMessage (E:\OneDrive\Documents\GitHub\whatsapp-chatgpt\src\handlers\message.ts:33:62)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at Client.<anonymous> (E:\OneDrive\Documents\GitHub\whatsapp-chatgpt\src\index.ts:46:5) {
status: 1,
signal: null,
output: [
null,
'Detecting language using up to the first 30 seconds. Use --language
to specify the language\r\n' +
'Detected language: Japanese\r\n',
'C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py:79: UserWarning: FP16 is not supported on CPU; using FP32 instead\r\n' +
' warnings.warn("FP16 is not supported on CPU; using FP32 instead")\r\n' +
'Traceback (most recent call last):\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\Scripts\whisper-script.py", line 33, in \r\n' +
" sys.exit(load_entry_point('openai-whisper==20230124', 'console_scripts', 'whisper')())\r\n" +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 314, in cli\r\n' +
' result = transcribe(model, audio_path, temperature=temperature, **args)\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 230, in transcribe\r\n' +
' add_segment(\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 170, in add_segment\r\n' +
' print(make_safe(f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}"))\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode\r\n' +
' return codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\n' +
"UnicodeEncodeError: 'charmap' codec can't encode characters in position 26-30: character maps to \r\n"
],
pid: 42600,
stdout: 'Detecting language using up to the first 30 seconds. Use --language
to specify the language\r\n' +
'Detected language: Japanese\r\n',
stderr: 'C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py:79: UserWarning: FP16 is not supported on CPU; using FP32 instead\r\n' +
' warnings.warn("FP16 is not supported on CPU; using FP32 instead")\r\n' +
'Traceback (most recent call last):\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\Scripts\whisper-script.py", line 33, in \r\n' +
" sys.exit(load_entry_point('openai-whisper==20230124', 'console_scripts', 'whisper')())\r\n" +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 314, in cli\r\n' +
' result = transcribe(model, audio_path, temperature=temperature, **args)\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 230, in transcribe\r\n' +
' add_segment(\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\site-packages\whisper\transcribe.py", line 170, in add_segment\r\n' +
' print(make_safe(f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}"))\r\n' +
' File "C:\Users\vcoop\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode\r\n' +
' return codecs.charmap_encode(input,self.errors,encoding_table)[0]\r\n' +
"UnicodeEncodeError: 'charmap' codec can't encode characters in position 26-30: character maps to \r\n"
Currently speech only supports english, we have plans to implement other langauges in the future :)
Ok, thank you for the info...much appreciated.
This error looks like it's related to the locally installed whisper transcription.
It has nothing to do with the TTS @connorv001
We need to try it out with other languages.
Any ideas on how to fix the errors?