1. 06 Feb, 2023 1 commit
    • Sylvain Gugger's avatar
      Update quality tooling for formatting (#21480) · 6f79d264
      Sylvain Gugger authored
      * Result of black 23.1
      
      * Update target to Python 3.7
      
      * Switch flake8 to ruff
      
      * Configure isort
      
      * Configure isort
      
      * Apply isort with line limit
      
      * Put the right black version
      
      * adapt black in check copies
      
      * Fix copies
      6f79d264
  2. 30 Jan, 2023 1 commit
  3. 25 Jan, 2023 2 commits
  4. 23 Jan, 2023 1 commit
  5. 20 Jan, 2023 1 commit
  6. 19 Jan, 2023 1 commit
    • Arthur's avatar
      [Whisper] Fix timestamp processor (#21187) · e9b4800d
      Arthur authored
      
      
      * add draft logit processor
      
      * add template functions
      
      * update timesapmt processor parameters
      
      * draft script
      
      * simplify code
      
      * cleanup
      
      * fixup and clean
      
      * update pipeline
      
      * style
      
      * clean up previous idea
      
      * add tokenization utils
      
      * update tokenizer and asr output
      
      * fit whisper type
      
      * style and update test
      
      * clean test
      
      * style test
      
      * update tests
      
      * update error test
      
      * udpate code (not based on review yet)
      
      * update tokenization
      
      * update asr pipeline
      
      * update code
      
      * cleanup and update test
      
      * fmt
      
      * remove text verificatino
      
      * cleanup
      
      * cleanup
      
      * add model test
      
      * update tests
      
      * update code add docstring
      
      * update code and add docstring
      
      * fix pipeline tests
      
      * add draft logit processor
      
      add template functions
      
      update timesapmt processor parameters
      
      draft script
      
      simplify code
      
      cleanup
      
      fixup and clean
      
      update pipeline
      
      style
      
      clean up previous idea
      
      add tokenization utils
      
      update tokenizer and asr output
      
      fit whisper type
      
      style and update test
      
      clean test
      
      style test
      
      update tests
      
      update error test
      
      udpate code (not based on review yet)
      
      update tokenization
      
      update asr pipeline
      
      update code
      
      cleanup and update test
      
      fmt
      
      remove text verificatino
      
      cleanup
      
      cleanup
      
      add model test
      
      update tests
      
      update code add docstring
      
      update code and add docstring
      
      fix pipeline tests
      
      * Small update.
      
      * Fixup.
      
      * Tmp.
      
      * More support.
      
      * Making `forced_decoder_ids` non mandatory for users to set.
      
      * update and fix first bug
      
      * properly process sequence right after merge if last
      
      * tofo
      
      * allow list inputs + compute begin index better
      
      * start adding tests
      
      * add the 3 edge cases
      
      * style
      
      * format sequences
      
      * fixup
      
      * update
      
      * update
      
      * style
      
      * test passes, edge cases should be good
      
      * update last value
      
      * remove Trie
      
      * update tests and expec ted values
      
      * handle bigger chunk_length
      
      * clean tests a bit
      
      * refactor chunk iter and clean pipeline
      
      * update tests
      
      * style
      
      * refactor chunk iter and clean pipeline
      
      * upade
      
      * resolve comments
      
      * Apply suggestions from code review
      Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
      
      * take stride right into account
      
      * update test expected values
      
      * Update code based on review
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      
      * major refactor
      
      * add correct strides for tests
      
      * Update src/transformers/pipelines/automatic_speech_recognition.py
      
      * fix whisper timestamp test
      Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      e9b4800d
  7. 17 Jan, 2023 1 commit
    • Arthur's avatar
      Whisper Timestamp processor and prediction (#20620) · bb300ac6
      Arthur authored
      
      
      * add draft logit processor
      
      * add template functions
      
      * update timesapmt processor parameters
      
      * draft script
      
      * simplify code
      
      * cleanup
      
      * fixup and clean
      
      * update pipeline
      
      * style
      
      * clean up previous idea
      
      * add tokenization utils
      
      * update tokenizer and asr output
      
      * fit whisper type
      
      * style and update test
      
      * clean test
      
      * style test
      
      * update tests
      
      * update error test
      
      * udpate code (not based on review yet)
      
      * update tokenization
      
      * update asr pipeline
      
      * update code
      
      * cleanup and update test
      
      * fmt
      
      * remove text verificatino
      
      * cleanup
      
      * cleanup
      
      * add model test
      
      * update tests
      
      * update code add docstring
      
      * update code and add docstring
      
      * fix pipeline tests
      
      * add draft logit processor
      
      add template functions
      
      update timesapmt processor parameters
      
      draft script
      
      simplify code
      
      cleanup
      
      fixup and clean
      
      update pipeline
      
      style
      
      clean up previous idea
      
      add tokenization utils
      
      update tokenizer and asr output
      
      fit whisper type
      
      style and update test
      
      clean test
      
      style test
      
      update tests
      
      update error test
      
      udpate code (not based on review yet)
      
      update tokenization
      
      update asr pipeline
      
      update code
      
      cleanup and update test
      
      fmt
      
      remove text verificatino
      
      cleanup
      
      cleanup
      
      add model test
      
      update tests
      
      update code add docstring
      
      update code and add docstring
      
      fix pipeline tests
      
      * Small update.
      
      * Fixup.
      
      * Tmp.
      
      * More support.
      
      * Making `forced_decoder_ids` non mandatory for users to set.
      
      * update and fix first bug
      
      * properly process sequence right after merge if last
      
      * tofo
      
      * allow list inputs + compute begin index better
      
      * start adding tests
      
      * add the 3 edge cases
      
      * style
      
      * format sequences
      
      * fixup
      
      * update
      
      * update
      
      * style
      
      * test passes, edge cases should be good
      
      * update last value
      
      * remove Trie
      
      * update tests and expec ted values
      
      * handle bigger chunk_length
      
      * clean tests a bit
      
      * refactor chunk iter and clean pipeline
      
      * update tests
      
      * style
      
      * refactor chunk iter and clean pipeline
      
      * upade
      
      * resolve comments
      
      * Apply suggestions from code review
      Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
      
      * take stride right into account
      
      * update test expected values
      
      * Update code based on review
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
      Co-authored-by: default avatarsgugger <sylvain.gugger@gmail.com>
      bb300ac6
  8. 31 Dec, 2022 1 commit
  9. 23 Dec, 2022 1 commit
    • Nicolas Patry's avatar
      Adding support for `fp16` for asr pipeline. (#20864) · f7f0ec2f
      Nicolas Patry authored
      * Supporting `fp16` for asr pipeline
      
      * Adding test.
      
      * Style.
      
      * Oops.
      
      * Flake8 update ?
      
      * Fixing flake8 ?
      
      * Revert "Flake8 update ?"
      
      This reverts commit 0b917fcb520e5f34d1933d9d37d8f32b64553048.
      
      * Style (acctidentally deleted flake8 F401.)
      
      * Move to a bigger test (no small whisper model, and s2t doesn't seem to
      accept torch_dtype=fp16).
      
      Also we need to use a GPU to actually compute on fp16.
      
      * Using BatchFeature capability.
      f7f0ec2f
  10. 06 Dec, 2022 1 commit
  11. 05 Dec, 2022 1 commit
  12. 14 Nov, 2022 1 commit
  13. 18 Oct, 2022 1 commit
  14. 14 Oct, 2022 1 commit
    • Nicolas Patry's avatar
      Improve error messaging for ASR pipeline. (#19570) · 463226e2
      Nicolas Patry authored
      * Improve error messaging for ASR pipeline.
      
      - Raise error early (in `_sanitize`) so users don't waste time trying to
        run queries with invalid params.
      
      - Fix the error was after using `config.inputs_to_logits_ratio` so our
        check was masked by the failing property does not exist.
      
      - Added some manual check on s2t for the error message.
        No non ctc model seems to be used by the default runner (they are all
        skipped).
      
      * Removing pdb.
      
      * Stop the early error it doesn't really work :(.
      463226e2
  15. 11 Oct, 2022 1 commit
    • Arthur's avatar
      Fix whisper for `pipeline` (#19482) · b722a6be
      Arthur authored
      * update feature extractor params
      
      * update attention mask handling
      
      * fix doc and pipeline test
      
      * add warning when skipping test
      
      * add whisper translation and transcription test
      
      * fix build doc test
      b722a6be
  16. 07 Oct, 2022 1 commit
    • Sylvain Gugger's avatar
      Rework pipeline tests (#19366) · 9ac586b3
      Sylvain Gugger authored
      * Rework pipeline tests
      
      * Try to fix Flax tests
      
      * Try to put it before
      
      * Use a new decorator instead
      
      * Remove ignore marker since it doesn't work
      
      * Filter pipeline tests
      
      * Woopsie
      
      * Use the fitlered list
      
      * Clean up and fake modif
      
      * Remove init
      
      * Revert fake modif
      9ac586b3
  17. 05 Aug, 2022 1 commit
    • Nicolas Patry's avatar
      Fixing issue where generic model types wouldn't load properly with the pipeline (#18392) · 586dcf6b
      Nicolas Patry authored
      * Adding a better error message when the model is improperly configured
      
      within transformers.
      
      * Update src/transformers/pipelines/__init__.py
      
      * Black version.
      
      * Overriding task aliases so that tokenizer+feature_extractor
      
      values are correct.
      
      * Fixing task aliases by overriding their names early
      
      * X.
      
      * Fixing feature-extraction.
      
      * black again.
      
      * Normalizing `translation` too.
      
      * Fixing last few corner cases.
      
      translation need to use its non normalized name (translation_XX_to_YY,
      so that the task_specific_params are correctly overloaded).
      This can be removed and cleaned up in a later PR.
      
      `speech-encode-decoder` actually REQUIRES to pass a `tokenizer` manually
      so the error needs to be discarded when the `tokenizer` is already
      there.
      
      * doc-builder fix.
      
      * Fixing the real issue.
      
      * Removing dead code.
      
      * Do not import the actual config classes.
      586dcf6b
  18. 12 May, 2022 1 commit
  19. 12 Apr, 2022 1 commit
    • Nicolas Patry's avatar
      Change the chunk_iter function to handle (#16730) · a192f61e
      Nicolas Patry authored
      * Change the chunk_iter function to handle
      
      the subtle cases where the last chunk gets ignored since all the
      data is in the `left_strided` data.
      
      We need to remove the right striding on the previous item.
      
      * Remove commented line.
      a192f61e
  20. 02 Mar, 2022 1 commit
  21. 28 Feb, 2022 1 commit
  22. 25 Feb, 2022 1 commit
  23. 23 Feb, 2022 1 commit
  24. 15 Feb, 2022 2 commits
  25. 07 Feb, 2022 1 commit
  26. 02 Feb, 2022 1 commit
    • Nicolas Patry's avatar
      Adding support for `microphone` streaming within pipeline. (#15046) · 623d8cb4
      Nicolas Patry authored
      
      
      * Adding support for `microphone` streaming within pipeline.
      
      - Uses `ffmpeg` to get microphone data.
      - Makes sure alignment is made to `size_of_sample`.
      - Works by sending `{"raw": ..data.., "stride": (n, left, right),
      "partial": bool}`
      directly to the pipeline enabling to stream partial results and still
      get inference.
      - Let's `partial` information flow through the pipeline to enable caller
        to get it back and choose to display text or not.
      
      - The striding reconstitution is bound to have errors since CTC does not
      keep previous state. Currently most of the errors are we don't know if
      there's a space or not between two chunks.
      Since we have some left striding info, we could use that during decoding
      to choose what to do with those spaces and even extra letters maybe (if
      the stride is long enough, it's bound to cover at least a few symbols)
      
      Fixing tests.
      
      Protecting with `require_torch`.
      
      `raw_ctc` support for nicer demo.
      
      Post rebase fixes.
      
      Revamp to split raw_mic_data from it's live chunking.
      
      - Requires a refactor to make everything a bit cleaner.
      
      Automatic resampling.
      
      Small fix.
      
      Small fix.
      
      * Post rebase fix (need to let super handle more logic, reorder args.)
      
      * Update docstrings
      
      * Docstring format.
      
      * Remove print.
      
      * Prevent flow of `input_values`.
      
      * Fixing `stride` too.
      
      * Fixing the PR by removing `raw_ctc`.
      
      * Better docstrings.
      
      * Fixing init.
      
      * Update src/transformers/pipelines/audio_utils.py
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * Update tests/test_pipelines_automatic_speech_recognition.py
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      
      * Quality.
      Co-authored-by: default avatarAnton Lozhkov <aglozhkov@gmail.com>
      623d8cb4
  27. 19 Jan, 2022 1 commit
  28. 18 Jan, 2022 2 commits
  29. 12 Jan, 2022 1 commit
  30. 04 Jan, 2022 1 commit
    • Nicolas Patry's avatar
      Hotfix `chunk_length_s` instead of `_ms`. (#15029) · 19d37c2d
      Nicolas Patry authored
      * Hotfix `chunk_length_s` instead of `_ms`.
      
      * Adding fix of `pad_token` which should be last/previous token for CTC
      
      proper decoding
      
      * Fixing ChunkPipeline unwrapping.
      
      * Adding a PackIterator specific test.
      19d37c2d
  31. 03 Jan, 2022 1 commit
  32. 30 Dec, 2021 1 commit
  33. 27 Dec, 2021 1 commit
    • Nicolas Patry's avatar
      ChunkPipeline (batch_size enabled on `zero-cls` and `qa` pipelines. (#14225) · b058490c
      Nicolas Patry authored
      
      
      * Pipeline chunks.
      
      * Batching for Chunking pipelines ?
      
      * Batching for `question-answering` and `zero-shot-cls`.
      
      * Fixing for FNet.
      
      * Making ASR a chunk pipeline.
      
      * Chunking ASR API.
      
      * doc style.
      
      * Fixing ASR test.
      
      * Fixing QA eror (p_mask, padding is 1, not 0).
      
      * Enable both vad and simple chunking.
      
      * Max length for vad.
      
      * remove inference mode, crashing on s2t.
      
      * Revert ChunkPipeline for ASRpipeline.
      
      Too many knobs for simple integration within the pipeline, better stick
      to external convenience functions instead, more control to be had,
      simpler pipeline and also easier to replace with other things later.
      
      * Drop necessity for PT for these.
      
      * Enabling generators.
      
      * Add mic + cleanup.
      
      * Typo.
      
      * Typo2.
      
      * Remove ASR work, it does not belong in this PR anymore.
      
      * Update src/transformers/pipelines/pt_utils.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Update src/transformers/pipelines/zero_shot_classification.py
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      
      * Adding many comments.
      
      * Doc quality.
      
      * `hidden_states` handling.
      
      * Adding doc.
      
      * Bad rebase.
      
      * Autofixing docs.
      
      * Fixing CRITICAL bug in the new Zerocls pipeline.
      Co-authored-by: default avatarLysandre Debut <lysandre@huggingface.co>
      b058490c
  34. 16 Dec, 2021 1 commit
  35. 17 Nov, 2021 1 commit
  36. 29 Oct, 2021 1 commit
  37. 14 Oct, 2021 1 commit