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

Feat: correct type hints #1150

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Equipo45
Copy link

@Equipo45 Equipo45 commented Nov 17, 2024

Description

Correct some type-hints in transcribe.py and vad.py files. The majority of the changes are in transcribe.py. The idea is to make it easier to understand and maintain in the future.
Did you consider creating data classes for more function returns, or can it be overwhelming?

Two type hints could be more problematic, I didn't touch them because it could change the transcribe logic, breaking it:

  • Here a dict is introduced and is expected to be a list of dicts:
    merge_punctuations(alignment, prepend_punctuations, append_punctuations)
  • Here a list of dicts is expected, but a list of list is introduced, but with a list of list the function shouldn't work...
if options.word_timestamps:
                self.add_word_timestamps(
                    [current_segments],

PD:
Thank you for contributing to the open-source community!

@Equipo45 Equipo45 force-pushed the feature/correct-some-type-hints branch from afde92c to 8aa0312 Compare November 17, 2024 12:56
@Equipo45 Equipo45 changed the title feat: correct type hints Feat: correct type hints Nov 17, 2024
@Equipo45 Equipo45 force-pushed the feature/correct-some-type-hints branch 2 times, most recently from d039127 to 05cc0a4 Compare November 17, 2024 15:15
@Equipo45 Equipo45 force-pushed the feature/correct-some-type-hints branch from 68f40db to 4599088 Compare December 4, 2024 12:35
@Equipo45 Equipo45 force-pushed the feature/correct-some-type-hints branch from 4599088 to 5f9bf53 Compare December 4, 2024 12:42
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

Successfully merging this pull request may close these issues.

1 participant