1. 30 May, 2023 2 commits
  2. 25 May, 2023 1 commit
  3. 24 May, 2023 6 commits
    • Daniel King's avatar
      Fix the regex in `get_imports` to support multiline try blocks and excepts... · 89159651
      Daniel King authored
      Fix the regex in `get_imports` to support multiline try blocks and excepts with specific exception types (#23725)
      
      * fix and test get_imports for multiline try blocks, and excepts with specific errors
      
      * fixup
      
      * add some more tests
      
      * add license
      89159651
    • Sanchit Gandhi's avatar
      d8222be5
    • Matt's avatar
      Overhaul TF serving signatures + dummy inputs (#23234) · 814de8fa
      Matt authored
      * Let's try autodetecting serving sigs
      
      * Don't clobber existing sigs
      
      * Change shapes for multiplechoice models
      
      * Make default dummy inputs smarter too
      
      * Fix missing f-string
      
      * Let's YOLO a serving output too
      
      * Read __class__.__name__ properly
      
      * Don't just pass naked lists in there and expect it to be okay
      
      * Code cleanup
      
      * Update default serving sig
      
      * Clearer error messages
      
      * Further updates to the default serving output
      
      * make fixup
      
      * Update the serving output a bit more
      
      * Cleanups and renames, raise errors appropriately when we can't infer inputs
      
      * More renames
      
      * we're building in a functional context again, yolo
      
      * import DUMMY_INPUTS from the right place
      
      * import DUMMY_INPUTS from the right place
      
      * Support cross-attention in the dummies
      
      * Support cross-attention in the dummies
      
      * Complete removal of dummy/serving overrides in BERT
      
      * Complete removal of dummy/serving overrides in RoBERTa
      
      * Obliterate lots and lots of serving sig and dummy overrides
      
      * merge type hint changes
      
      * Fix for token_type_ids with vocab_size 1
      
      * Add missing property decorator
      
      * Fix T5 and hopefully some models that take conv inputs
      
      * More signature pruning
      
      * Fix T5's signature
      
      * Fix Wav2Vec2 signature
      
      * Fix LongformerForMultipleChoice input signature
      
      * Fix BLIP and LED
      
      * Better default serving output error handling
      
      * Fix BART dummies
      
      * Fix dummies for cross-attention, esp encoder-decoder models
      
      * Fix visionencoderdecoder signature
      
      * Fix BLIP serving output
      
      * Small tweak to BART dummies
      
      * Cleanup the ugly parameter inspection line that I used in a few places
      
      * committed a breakpoint again
      
      * Move the text_dims check
      
      * Remove blip_text serving_output
      
      * Add decoder_input_ids to the default input sig
      
      * Remove all the manual overrides for encoder-decoder model signatures
      
      * Tweak longformer/led input sigs
      
      * Tweak default serving output
      
      * output.keys() -> output
      
      * make fixup
      814de8fa
    • Matt's avatar
      Better TF docstring types (#23477) · f8b25744
      Matt authored
      * Rework TF type hints to use | None instead of Optional[] for tf.Tensor
      
      * Rework TF type hints to use | None instead of Optional[] for tf.Tensor
      
      * Don't forget the imports
      
      * Add the imports to tests too
      
      * make fixup
      
      * Refactor tests that depended on get_type_hints
      
      * Better test refactor
      
      * Fix an old hidden bug in the test_keras_fit input creation code
      
      * Fix for the Deit tests
      f8b25744
    • Tim Dettmers's avatar
      Paged Optimizer + Lion Optimizer for Trainer (#23217) · 796162c5
      Tim Dettmers authored
      
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      796162c5
    • Tim Dettmers's avatar
      4-bit QLoRA via bitsandbytes (4-bit base model + LoRA) (#23479) · 9d73b922
      Tim Dettmers authored
      
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      * Initial draft. Some tests fail.
      
      * Fixed dtype bug.
      
      * Fixed bug caused by torch_dtype='auto'.
      
      * All test green for 8-bit and 4-bit layers.
      
      * Added fix for fp32 layer norms and bf16 compute in LLaMA.
      
      * Initial draft. Some tests fail.
      
      * Fixed dtype bug.
      
      * Fixed bug caused by torch_dtype='auto'.
      
      * All test green for 8-bit and 4-bit layers.
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      * Fixing issues for PR #23479.
      
      * Added fix for fp32 layer norms and bf16 compute in LLaMA.
      
      * Reverted variable name change.
      
      * Initial draft. Some tests fail.
      
      * Fixed dtype bug.
      
      * Fixed bug caused by torch_dtype='auto'.
      
      * All test green for 8-bit and 4-bit layers.
      
      * Added lion and paged optimizers and made original tests pass.
      
      * Added tests for paged and lion optimizers.
      
      * Added and fixed optimizer tests.
      
      * Style and quality checks.
      
      * Added missing tests.
      
      * Fixup changes.
      
      * Added fixup changes.
      
      * Missed some variables to rename.
      
      * revert trainer tests
      
      * revert test trainer
      
      * another revert
      
      * fix tests and safety checkers
      
      * protect import
      
      * simplify a bit
      
      * Update src/transformers/trainer.py
      
      * few fixes
      
      * add warning
      
      * replace with `load_in_kbit = load_in_4bit or load_in_8bit`
      
      * fix test
      
      * fix tests
      
      * this time fix tests
      
      * safety checker
      
      * add docs
      
      * revert torch_dtype
      
      * Apply suggestions from code review
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * multiple fixes
      
      * update docs
      
      * version checks and multiple fixes
      
      * replace `is_loaded_in_kbit`
      
      * replace `load_in_kbit`
      
      * change methods names
      
      * better checks
      
      * oops
      
      * oops
      
      * address final comments
      
      ---------
      Co-authored-by: default avataryounesbelkada <younesbelkada@gmail.com>
      Co-authored-by: default avatarYounes Belkada <49240599+younesbelkada@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      9d73b922
  4. 23 May, 2023 5 commits
  5. 22 May, 2023 4 commits
  6. 20 May, 2023 1 commit
  7. 19 May, 2023 3 commits
    • Younes Belkada's avatar
      [`Blip`] Remove redundant shift right (#23153) · 3cb93090
      Younes Belkada authored
      * remove redundant shit right
      
      * fix failing tests
      
      * this time fix tests
      3cb93090
    • Matt's avatar
      TF port of the Segment Anything Model (SAM) (#22970) · 1c460a52
      Matt authored
      
      
      * First commit
      
      * Add auto-translation with GPT-4
      
      * make fixup
      
      * Add a functional layernorm for TF
      
      * Add all the auxiliary imports etc.
      
      * Add the extra processor and tests
      
      * rebase to main
      
      * Add all the needed fixes to the GPT code
      
      * make fixup
      
      * Make convolutions channels-last so they run on CPU
      
      * make fixup
      
      * Fix final issues
      
      * Fix other models affected by test change
      
      * Clarify comment on the sparse_prompt_embeddings check
      
      * Refactor functional_layernorm, use shape_list in place of .shape in some places
      
      * Remove deprecated torch-alike code
      
      * Update tests/models/sam/test_modeling_tf_sam.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update tests/models/sam/test_modeling_tf_sam.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Refactor processor with common methods and separated private methods
      
      * make fixup
      
      * Quietly delete the file that didn't do anything (sorry Sylvain)
      
      * Refactor the processor tests into one file
      
      * make fixup
      
      * Clean up some unnecessary indirection
      
      * Fix TF mask postprocessing
      
      * Add more processor equivalence tests
      
      * Refactor generate_crop_boxes to use framework-neutral np code
      
      * Make the serving output correctly conditional
      
      * Fix error message line length
      
      * Use dict keys rather than indices internally in both TF and PT SAM call/forward
      
      * Return dicts internally in the call/forward methods
      
      * Revert changes to common tests and just override check_pt_tf_outputs
      
      * Revert changes to other model tests
      
      * Clarify comments for functional layernorm
      
      * Add missing transpose from PT code
      
      * Removed unused copied from in PT code
      
      * Remove overrides for tests that don't exist in TF
      
      * Fix transpose and update tests for PT and TF to check pred_masks
      
      * Add training flag
      
      * Update tests to use TF checkpoints
      
      * Update index.mdx
      
      * Add missing cross-test decorator
      
      * Remove optional extra asterisks
      
      * Revert return_dict changes in PT code
      
      * Update src/transformers/models/sam/modeling_tf_sam.py
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      
      * Remove None return annotations on init methods
      
      * Update tests/models/sam/test_processor_sam.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Fix input_boxes shapes
      
      * make fixup
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      Co-authored-by: default avatarSylvain Gugger <35901082+sgugger@users.noreply.github.com>
      1c460a52
    • Connor Henderson's avatar
      feat: Whisper prompting (#22496) · 2acedf47
      Connor Henderson authored
      * initial working additions
      
      * clean and rename, add cond stripping initial prompt to decode
      
      * cleanup, edit create_initial_prompt_ids, add tests
      
      * repo consistency, flip order of conditional
      
      * fix error, move the processor fn to the tokenizer
      
      * repo consistency, update test ids to corresponding tokenizer
      
      * use convert_tokens_to_ids not get_vocab...
      
      * use actual conditional in generate
      
      * make sytle
      
      * initial address comments
      
      * initial working add new params to pipeline
      
      * first draft of sequential generation for condition_on_previous_text
      
      * add/update tests, make compatible with timestamps
      
      * make compatible with diff. input kwargs and max length
      
      * add None check
      
      * add temperature check
      
      * flip temp check operand
      
      * refocusing to prev pr scope
      
      * remove the params too
      
      * make style
      
      * edits, move max length incorporating prompt to whisper
      
      * address comments
      
      * remove asr pipeline prompt decoding, fix indexing
      
      * address comments (more tests, validate prompt)
      
      * un-comment out tests (from debug)
      
      * remove old comment
      
      * address comments
      
      * fix typo
      
      * remove timestamp token from test
      
      * make style
      
      * cleanup
      
      * copy method to fast tokenizer, set max_new_tokens for test
      
      * prompt_ids type just pt
      
      * address Amy's comments
      
      * make style
      2acedf47
  8. 18 May, 2023 4 commits
  9. 17 May, 2023 4 commits
  10. 16 May, 2023 4 commits
  11. 15 May, 2023 3 commits
  12. 12 May, 2023 1 commit
  13. 11 May, 2023 2 commits