Comments (5)
Aah yes. You'll need to add
.decode('utf-8', 'ignore')
and.encode(...)
while writing to file/saving
thk, it worked.
AutoSub/autosub/writeToFile.py
Line 43 in 5dc2314
file_handle.write(inferred_text.decode('utf-8', 'ignore').encode('utf-8') + "\n\n")
Line 140 in 5dc2314
output_file_handle_dict[format] = open(output_filename, "w", encoding='utf-8', errors='surrogateescape')
from autosub.
and here, "non-utf-8" codec error
raceback (most recent call last):
File "autosub/main.py", line 170, in <module>
main()
File "autosub/main.py", line 161, in main
ds_process_audio(ds, audio_segment_path, output_file_handle_dict, split_duration=args.split_duration)
File "autosub/main.py", line 69, in ds_process_audio
write_to_file(output_file_handle_dict, split_inferred_text, line_count, split_limits, cues)
File "C:\env\python-venv\deepspeech\lib\site-packages\autosub\writeToFile.py", line 43, in write_to_file
file_handle.write(inferred_text + "\n\n")
UnicodeEncodeError: 'gbk' codec can't encode character '\udce9' in position 0: illegal multibyte sequence
——————————
edit:"utf-8" codec error too, idk why.
raceback (most recent call last):
File "autosub/main.py", line 170, in <module>
main()
File "autosub/main.py", line 161, in main
ds_process_audio(ds, audio_segment_path, output_file_handle_dict, split_duration=args.split_duration)
File "autosub/main.py", line 69, in ds_process_audio
write_to_file(output_file_handle_dict, split_inferred_text, line_count, split_limits, cues)
File "C:\env\python-venv\deepspeech\lib\site-packages\autosub\writeToFile.py", line 43, in write_to_file
file_handle.write(inferred_text + "\n\n")
UnicodeEncodeError: 'utf-8' codec can't encode characters in position 0-262: surrogates not allowed
from autosub.
Weird. Which language is your audio in?
from autosub.
Weird. Which language is your audio in?
mandarin, I found many people have the same problem in python.
mozilla/DeepSpeech#3557
but i didn't find a solution
from autosub.
Aah yes. You'll need to add .decode('utf-8', 'ignore')
and .encode(...)
while writing to file/saving
from autosub.
Related Issues (20)
- 1
- fix imports to autosub module
- flac not wav HOT 1
- multi core
- stream not stack = write result to disk more often
- ImportError: attempted relative import with no known parent package HOT 8
- Broken Docker build HOT 1
- Broken logging module import HOT 1
- Move model COPY steps higher in Dockerfile
- Docker build broken HOT 6
- Cannot import logger HOT 1
- Issue in running model HOT 1
- Problem running on Mac OS X Moterey HOT 3
- Include OpenAI Whisper model HOT 1
- Generated VTT files are not standard compliant
- ERROR: Could not find a version that satisfies the requirement stt==1.0.0 HOT 1
- Docker run return ` No module named 'autosub'` HOT 1
- Feature Request: Readme update for Windows users
- Instructions not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autosub.