1. 17 Jun, 2024 4 commits
    • Albert Villanova del Moral's avatar
      Pass datasets trust_remote_code (#31406) · a14b055b
      Albert Villanova del Moral authored
      * Pass datasets trust_remote_code
      
      * Pass trust_remote_code in more tests
      
      * Add trust_remote_dataset_code arg to some tests
      
      * Revert "Temporarily pin datasets upper version to fix CI"
      
      This reverts commit b7672826.
      
      * Pass trust_remote_code in librispeech_asr_dummy docstrings
      
      * Revert "Pin datasets<2.20.0 for examples"
      
      This reverts commit 833fc17a.
      
      * Pass trust_remote_code to all examples
      
      * Revert "Add trust_remote_dataset_code arg to some tests" to research_projects
      
      * Pass trust_remote_code to tests
      
      * Pass trust_remote_code to docstrings
      
      * Fix flax examples tests requirements
      
      * Pass trust_remote_dataset_code arg to tests
      
      * Replace trust_remote_dataset_code with trust_remote_code in one example
      
      * Fix duplicate trust_remote_code
      
      * Replace args.trust_remote_dataset_code with args.trust_remote_code
      
      * Replace trust_remote_dataset_code with trust_remote_code in parser
      
      * Replace trust_remote_dataset_code with trust_remote_code in dataclasses
      
      * Replace trust_remote_dataset_code with trust_remote_code arg
      a14b055b
    • Bastien Le Chenadec's avatar
      Support multiple validation datasets when `dataloader_persistent_workers=True` (#30627) · 485fd814
      Bastien Le Chenadec authored
      * Support multiple validation datasets when dataloader_persistent_workers=True
      
      * Test support of multiple validation datasets
      485fd814
    • Fanli Lin's avatar
      [tests] make `TestDeepSpeedModelZoo` device-agnostic (#31402) · 9454f437
      Fanli Lin authored
      * fix
      
      * use accelerator device count
      
      * ci fix
      9454f437
    • amyeroberts's avatar
      02c525d2
  2. 14 Jun, 2024 3 commits
  3. 13 Jun, 2024 1 commit
    • Pablo Montalvo's avatar
      add initial design for uniform processors + align model (#31197) · c624d5ba
      Pablo Montalvo authored
      * add initial design for uniform processors + align model
      
      * fix mutable default 👀
      
      * add configuration test
      
      * handle structured kwargs w defaults + add test
      
      * protect torch-specific test
      
      * fix style
      
      * fix
      
      * fix assertEqual
      
      * move kwargs merging to processing common
      
      * rework kwargs for type hinting
      
      * just get Unpack from extensions
      
      * run-slow[align]
      
      * handle kwargs passed as nested dict
      
      * add from_pretrained test for nested kwargs handling
      
      * [run-slow]align
      
      * update documentation + imports
      
      * update audio inputs
      
      * protect audio types, silly
      
      * try removing imports
      
      * make things simpler
      
      * simplerer
      
      * move out kwargs test to common mixin
      
      * [run-slow]align
      
      * skip tests for old processors
      
      * [run-slow]align, clip
      
      * !$#@!! protect imports, darn it
      
      * [run-slow]align, clip
      
      * [run-slow]align, clip
      
      * update doc
      
      * improve documentation for default values
      
      * add model_max_length testing
      
      This parameter depends on tokenizers received.
      
      * Raise if kwargs are specified in two places
      
      * fix
      
      * expand VideoInput
      
      * fix
      
      * fix style
      
      * remove defaults values
      
      * add comment to indicate documentation on adding kwargs
      
      * protect imports
      
      * [run-slow]align
      
      * fix
      
      * remove set() that breaks ordering
      
      * test more
      
      * removed unused func
      
      * [run-slow]align
      c624d5ba
  4. 12 Jun, 2024 2 commits
  5. 11 Jun, 2024 2 commits
    • amyeroberts's avatar
      Fast image processor (#28847) · f53fe35b
      amyeroberts authored
      
      
      * Draft fast image processors
      
      * Draft working fast version
      
      * py3.8 compatible cache
      
      * Enable loading fast image processors through auto
      
      * Tidy up; rescale behaviour based on input type
      
      * Enable tests for fast image processors
      
      * Smarter rescaling
      
      * Don't default to Fast
      
      * Safer imports
      
      * Add necessary Pillow requirement
      
      * Woops
      
      * Add AutoImageProcessor test
      
      * Fix up
      
      * Fix test for imagegpt
      
      * Fix test
      
      * Review comments
      
      * Add warning for TF and JAX input types
      
      * Rearrange
      
      * Return transforms
      
      * NumpyToTensor transformation
      
      * Rebase - include changes from upstream in ImageProcessingMixin
      
      * Safe typing
      
      * Fix up
      
      * convert mean/std to tesnor to rescale
      
      * Don't store transforms in state
      
      * Fix up
      
      * Update src/transformers/image_processing_utils_fast.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Update src/transformers/models/auto/image_processing_auto.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Update src/transformers/models/auto/image_processing_auto.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Update src/transformers/models/auto/image_processing_auto.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Warn if fast image processor available
      
      * Update src/transformers/models/vit/image_processing_vit_fast.py
      
      * Transpose incoming numpy images to be in CHW format
      
      * Update mapping names based on packages, auto set fast to None
      
      * Fix up
      
      * Fix
      
      * Add AutoImageProcessor.from_pretrained(checkpoint, use_fast=True) test
      
      * Update src/transformers/models/vit/image_processing_vit_fast.py
      Co-authored-by: default avatarPavel Iakubovskii <qubvel@gmail.com>
      
      * Add equivalence and speed tests
      
      * Fix up
      
      ---------
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      Co-authored-by: default avatarPavel Iakubovskii <qubvel@gmail.com>
      f53fe35b
    • Matt's avatar
      Chat Template support for function calling and RAG (#30621) · edc1dffd
      Matt authored
      
      
      * First draft, still missing automatic function conversion
      
      * First draft of the automatic schema generator
      
      * Lots of small fixes
      
      * the walrus has betrayed me
      
      * please stop committing your debug breakpoints
      
      * Lots of cleanup and edge cases, looking better now
      
      * Comments and bugfixes for the type hint parser
      
      * More cleanup
      
      * Add tests, update schema generator
      
      * Update tests, proper handling of return values
      
      * Small docstring change
      
      * More doc updates
      
      * More doc updates
      
      * Add json_schema decorator
      
      * Clean up the TODOs and finish the docs
      
      * self.maxDiff = None to see the whole diff for the nested list test
      
      * add import for add_json_schema
      
      * Quick test fix
      
      * Fix something that was bugging me in the chat template docstring
      
      * Less "anyOf" when unnecessary
      
      * Support return types for the templates that need them
      
      * Proper return type tests
      
      * Switch to Google format docstrings
      
      * Update chat templating docs to match new format
      
      * Stop putting the return type in with the other parameters
      
      * Add Tuple support
      
      * No more decorator - we just do it implicitly!
      
      * Add enum support to get_json_schema
      
      * Update docstring
      
      * Add copyright header
      
      * Update src/transformers/tokenization_utils_base.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update docs/source/en/chat_templating.md
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update src/transformers/utils/chat_template_utils.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update src/transformers/utils/chat_template_utils.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Add copyright header
      
      * make fixup
      
      * Fix indentation
      
      * Reformat chat_template_utils
      
      * Correct return value
      
      * Make regexes module-level
      
      * Support more complex, multi-line arg docstrings
      
      * Update error message for ...
      
      * Update ruff
      
      * Add document type validation
      
      * Refactor docs
      
      * Refactor docs
      
      * Refactor docs
      
      * Clean up Tuple error
      
      * Add an extra test for very complex defs and docstrings and clean everything up for it
      
      * Document enum block
      
      * Quick test fixes
      
      * Stop supporting type hints in docstring to fix bugs and simplify the regex
      
      * Update docs for the regex change
      
      * Clean up enum regex
      
      * Wrap functions in {"type": "function", "function": ...}
      
      * Update src/transformers/utils/chat_template_utils.py
      Co-authored-by: default avatarPablo Montalvo <39954772+molbap@users.noreply.github.com>
      
      * Temporary tool calling commit
      
      * Add type hints to chat template utils, partially update docs (incomplete!)
      
      * Code cleanup based on @molbap's suggestion
      
      * Add comments to explain regexes
      
      * Fix up type parsing for unions and lists
      
      * Add custom exception types and adjust tests to look for them
      
      * Update docs with a demo!
      
      * Docs cleanup
      
      * Pass content as string
      
      * Update tool call formatting
      
      * Update docs with new function format
      
      * Update docs
      
      * Update docs with a second tool to show the model choosing correctly
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      Co-authored-by: default avatarPablo Montalvo <39954772+molbap@users.noreply.github.com>
      edc1dffd
  6. 10 Jun, 2024 4 commits
  7. 07 Jun, 2024 6 commits
    • amyeroberts's avatar
      Rename test_model_common_attributes -> test_model_get_set_embeddings (#31321) · 25245ec2
      amyeroberts authored
      * Rename to test_model_common_attributes
      The method name is misleading - it is testing being able to get and set embeddings, not common attributes to all models
      
      * Explicitly skip
      25245ec2
    • BHUVAN M's avatar
      interpolation added for TVP. (#30863) · 3b9174f2
      BHUVAN M authored
      * Update TVP model to interpolate pre-trained image pad prompter encodings
      
      * feat: Add 2D positional embeddings interpolation in TvpVisualInputEmbedding
      
      * added required comments
      
      * Update TVP model to interpolate pre-trained image pad prompter encodings
      
      * feat: Add 2D positional embeddings interpolation in TvpVisualInputEmbedding
      
      * added required comments
      
      * docstring and argument fix
      
      * doc fixes and test case fix suggested in review.
      
      * varibale typo fix
      
      * styling and name fixes for padding interpolation flag.
      3b9174f2
    • Matt's avatar
      Remove ConversationalPipeline and Conversation object (#31165) · 065729a6
      Matt authored
      * Remove ConversationalPipeline and Conversation object, as they have been deprecated for some time and are due for removal
      
      * Update not-doctested.txt
      
      * Fix JA and ZH docs
      
      * Fix JA and ZH docs some more
      
      * Fix JA and ZH docs some more
      065729a6
    • 조준래's avatar
      Implement JSON dump conversion for torch_dtype in TrainingArguments (#31224) · 60861fe1
      조준래 authored
      
      
      * Implement JSON dump conversion for torch_dtype in TrainingArguments
      
      * Add unit test for converting torch_dtype in TrainingArguments to JSON
      
      * move unit test for converting torch_dtype into TrainerIntegrationTest class
      
      * reformating using ruff
      
      * convert dict_torch_dtype_to_str to private method _dict_torch_dtype_to_str
      
      ---------
      Co-authored-by: default avatarjun.4 <jun.4@kakaobrain.com>
      60861fe1
    • Benjamin Badger's avatar
      Extend save_pretrained to offloaded models (#27412) · ff689f57
      Benjamin Badger authored
      
      
      * added hidden subset
      
      * debugged hidden subset contrastive search
      
      * added contrastive search compression
      
      * debugged compressed contrastive search
      
      * memory reduction for contrastive search
      
      * debugged mem red
      
      * added low memory option feature
      
      * debugged mem optmimization output stack
      
      * debugged mem optmimization output stack
      
      * debugged low mem
      
      * added low mem cache
      
      * fixed 2047 tensor view
      
      * debugged 2042 past key val inputs
      
      * reformatted tensors
      
      * changed low mem output
      
      * final clean
      
      * removed subset hidden csearch
      
      * fixed hidden device
      
      * fixed hidden device
      
      * changed compressor dtype
      
      * removed hstate compression
      
      * integrated csearch in generate
      
      * test csearch integration into generation
      
      exit()
      
      * fixed csearch kwarg integration with generation
      
      * final wrap and added doc
      
      * Update src/transformers/generation/utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * Update src/transformers/generation/utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * Update src/transformers/generation/utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * added debug print
      
      * direct hstate cat
      
      * direct hstate cat
      
      * direct hstate cat debug
      
      * direct hstate cat debug
      
      * expanded full hidden state stack
      
      * expanded full hidden state stack
      
      * matched dims for hstates
      
      * matched dims for hstates
      
      * logits fix
      
      * equality test
      
      * equality hidden debug
      
      * debug
      
      * added prints for debug
      
      * added prints for debug
      
      * equality check
      
      * switched squeeze dim
      
      * input format debug
      
      * tracing top_k_ids
      
      * removed trace
      
      * added test context
      
      * added jitter
      
      * added jitter
      
      * added jitter
      
      * returned state
      
      * rebuilt past key value reconstruction
      
      * debugged
      
      * cleaned traces
      
      * added selection for pkv
      
      * changed output to dict
      
      * cleaned
      
      * cleaned
      
      * cleaned up contrastive search test
      
      * moved low_memory kwarg
      
      * debugged
      
      * changed low mem test batch size to 1
      
      * removed output
      
      * debugged test input shape
      
      * reformatted csearch test
      
      * added trace
      
      * removed unsqueeze on final forward pass
      
      * replaced unsqueeze with view
      
      * removed traces
      
      * cleaned
      
      * debugged model kwargs
      
      * removed special models from test
      
      * ran make quality
      
      * Update src/transformers/generation/configuration_utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * Update src/transformers/generation/configuration_utils.py
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      
      * refactored
      
      * refactored
      
      * refactored
      
      * make fixup
      
      * renamed flag sequential
      
      * renamed flag sequential
      
      * iterative onloading
      
      * black style and test utils
      
      * added traces for integrated test
      
      * debugged
      
      * added traces
      
      * make style
      
      * removed traces, make style
      
      * included suggestions and added test
      
      * debugged test
      
      * added offload module check and make style
      
      * is_accelerate_available and make style
      
      * added test decorator
      
      * changed test model and config spec
      
      * added offload condition
      
      * added lazy loading for each shard
      
      * debugged
      
      * modified sharding
      
      * debugged
      
      * added traces
      
      * removed safe serialization
      
      * no index overload;
      
      * trace on safe save ptrs
      
      * added ptr condition
      
      * debugged
      
      * debugged ptr
      
      * moved module map init
      
      * remake shard only for offloaded modules
      
      * refactored
      
      * debugged
      
      * refactored
      
      * debugged
      
      * cleaned and make style
      
      * cleaned and make style
      
      * added trace
      
      * sparse module map
      
      * debugged
      
      * removed module map conditional
      
      * refactored
      
      * debug
      
      * debugged
      
      * added traces
      
      * added shard mem trace
      
      * added shard mem trace
      
      * removed underlying storage check
      
      * refactored
      
      * memory leak removal and make style
      
      * cleaned
      
      * swapped test decs and make style
      
      * added mem checks and make style
      
      * added free mem warning
      
      * implemented some suggestions
      
      * moved onloading to accelerate
      
      * refactored for accelerate integration
      
      * cleaned test
      
      * make style
      
      * debugged offload map name
      
      * cleaned and make style
      
      * replaced meta device check for sharding
      
      * cleaned and make style
      
      * implemented some suggestions
      
      * more suggestions
      
      * update warning
      Co-authored-by: default avatarMarc Sun <57196510+SunMarc@users.noreply.github.com>
      
      * more suggestions
      
      * make style
      
      * new make style
      
      * Update src/transformers/modeling_utils.py
      Co-authored-by: default avatarMarc Sun <57196510+SunMarc@users.noreply.github.com>
      
      * Update src/transformers/modeling_utils.py
      Co-authored-by: default avatarMarc Sun <57196510+SunMarc@users.noreply.github.com>
      
      * Update src/transformers/modeling_utils.py
      Co-authored-by: default avatarMarc Sun <57196510+SunMarc@users.noreply.github.com>
      
      * Update src/transformers/modeling_utils.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      ---------
      Co-authored-by: default avatarJoao Gante <joaofranciscocardosogante@gmail.com>
      Co-authored-by: default avatarMarc Sun <57196510+SunMarc@users.noreply.github.com>
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      ff689f57
    • Cyril Vallez's avatar
      Fix jetmoe model (#31279) · 8bcf9c8d
      Cyril Vallez authored
      * Fix jetmoe model
      
      * Remove skip-tests
      8bcf9c8d
  8. 06 Jun, 2024 7 commits
  9. 05 Jun, 2024 2 commits
  10. 04 Jun, 2024 7 commits
  11. 03 Jun, 2024 2 commits