Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

writing json file error #12

Open
ilanit1997 opened this issue Nov 15, 2023 · 2 comments
Open

writing json file error #12

ilanit1997 opened this issue Nov 15, 2023 · 2 comments

Comments

@ilanit1997
Copy link

Hi,

When I try to run the json_writer, it is not possible using your package, as the results dictionary contains tensors which are not JSON serializable.

`from whisper_at.utils import get_writer

json_writer = get_writer("json", ".")
writer_args = {"highlight_words": False, "max_line_count": None, "max_line_width": None}
json_writer(result, "test", writer_args)

TypeError: Object of type Tensor is not JSON serializable`

The simple solution would be to pop the audio_tags entry and to creater a new writer for the audio tags, but any other alternative workaround is appreciated.

Thanks!

@YuanGongND
Copy link
Owner

hi there,

I assume writing to json is not included in our original code, right?

@ilanit1997
Copy link
Author

From what I can tell - in transcribe.py you only use the original whisper function:

writer = get_writer(output_format, output_dir)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants