1. 18 Sep, 2023 4 commits
  2. 15 Sep, 2023 7 commits
  3. 14 Sep, 2023 12 commits
    • Leo Tronchon's avatar
      IDEFICS: allow interpolation of vision's pos embeddings (#26029) · 869733ab
      Leo Tronchon authored
      
      
      * add pos embed interpolation for vision encoder
      
      * style
      
      * update config with interpolate_pos_encoding arg
      
      * fix imports formatting
      
      * take off copied from on vision embeddings
      
      * add test for image embeddings interpolation
      
      * add credit for interpolation code
      
      * Update src/transformers/models/idefics/configuration_idefics.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update src/transformers/models/idefics/vision.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * fix condition to check nbr image patches match shape of pos embeddings
      
      * use kwargs in the forward methods for interpolation
      
      * fix tests
      
      * have interpolate_pos_encoding default to False instead of None
      
      * Update tests/models/idefics/test_modeling_idefics.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update tests/models/idefics/test_modeling_idefics.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update tests/models/idefics/test_modeling_idefics.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update src/transformers/models/idefics/configuration_idefics.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * take off for loop meant to print k,v
      
      * add interpolate_pos_encoding arg in prepare_inputs_for_generation
      
      * add test for interpolated generation
      
      * fix edge case num_patches == num_positions and height == width
      
      * add test for edge case
      
      * fix pos_embed in interpolate
      
      * allow interpolation in bf16 with upcasting
      
      * Update src/transformers/models/idefics/vision.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Update src/transformers/models/idefics/vision.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * add multiple images tests for interpolation and generation
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      869733ab
    • NielsRogge's avatar
      [BLIP-2] Improve conversion script (#24854) · 5469c187
      NielsRogge authored
      * Improve conversion script
      
      * Add int8 code example
      
      * Update tip
      
      * Fix code
      
      * Fix code snippet
      
      * Add nucleus sampling
      
      * More improvements
      
      * Address comments
      
      * Address comments
      5469c187
    • Jinho Park's avatar
      Add BROS (#23190) · 17fdd354
      Jinho Park authored
      
      
      * add Bros boilerplate
      
      * copy and pasted modeling_bros.py from official Bros repo
      
      * update copyright of bros files
      
      * copy tokenization_bros.py from official repo and update import path
      
      * copy tokenization_bros_fast.py from official repo and update import path
      
      * copy configuration_bros.py from official repo and update import path
      
      * remove trailing period in copyright line
      
      * copy and paste bros/__init__.py from official repo
      
      * save formatting
      
      * remove unused unnecessary pe_type argument - using only crel type
      
      * resolve import issue
      
      * remove unused model classes
      
      * remove unnecessary tests
      
      * remove unused classes
      
      * fix original code's bug - layer_module's argument order
      
      * clean up modeling auto
      
      * add bbox to prepare_config_and_inputs
      
      * set temporary value to hidden_size (32 is too low because of the of the
      Bros' positional embedding)
      
      * remove decoder test, update create_and_check* input arguemnts
      
      * add missing variable to model tests
      
      * do make fixup
      
      * update bros.mdx
      
      * add boilerate plate for no_head inference test
      
      * update BROS_PRETRAINED_MODEL_ARCHIVE_LIST (add naver-clova-ocr prefix)
      
      * add prepare_bros_batch_inputs function
      
      * update modeling_common to add bbox inputs in Bros Model Test
      
      * remove unnecessary model inference
      
      * add test case
      
      * add model_doc
      
      * add test case for token_classification
      
      * apply fixup
      
      * update modeling code
      
      * update BrosForTokenClassification loss calculation logic
      
      * revert logits preprocessing logic to make sure logits have original shape
      
      * - update class name
      
      * - add BrosSpadeOutput
      - update BrosConfig arguments
      
      * add boilerate plate for no_head inference test
      
      * add prepare_bros_batch_inputs function
      
      * add test case
      
      * add test case for token_classification
      
      * update modeling code
      
      * update BrosForTokenClassification loss calculation logic
      
      * revert logits preprocessing logic to make sure logits have original shape
      
      * apply masking on the fly
      
      * add BrosSpadeForTokenLinking
      
      * update class name
      put docstring to the beginning of the file
      
      * separate the logits calculation logic and loss calculation logic
      
      * update logic for loss calculation so that logits shape doesn't change
      when return
      
      * update typo
      
      * update prepare_config_and_inputs
      
      * update dummy node initialization
      
      * update last_hidden_states getting logic to consider when return_dict is False
      
      * update box first token mask param
      
      * bugfix: remove random attention mask generation
      
      * update keys to ignore on load missing
      
      * run make style and quality
      
      * apply make style and quality of other codes
      
      * update box_first_token_mask to bool type
      
      * update index.md
      
      * apply make style and quality
      
      * apply make fix-copies
      
      * pass check_repo
      
      * update bros model doc
      
      * docstring bugfix fix
      
      * add checkpoint for doc, tokenizer for doc
      
      * Update README.md
      
      * Update docs/source/en/model_doc/bros.md
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update bros.md
      
      * Update src/transformers/__init__.py
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Update docs/source/en/model_doc/bros.md
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * Apply suggestions from code review
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      * apply suggestions from code review
      
      * apply suggestions from code review
      
      * revert test_processor_markuplm.py
      
      * Update test_processor_markuplm.py
      
      * apply suggestions from code review
      
      * apply suggestions from code review
      
      * apply suggestions from code review
      
      * update BrosSpadeELForTokenClassification head name to entity linker
      
      * add doc string for config params
      
      * update class, var names to more explicit and apply suggestions from code review
      
      * remove unnecessary keys to ignore
      
      * update relation extractor to be initialized with config
      
      * add bros processor
      
      * apply make style and quality
      
      * update bros.md
      
      * remove bros tokenizer, add bros processor that wraps bert tokenizer
      
      * revert change
      
      * apply make fix-copies
      
      * update processor code, update itc -> initial token, stc -> subsequent token
      
      * add type hint
      
      * remove unnecessary condition branches in embedding forward
      
      * fix auto tokenizer fail
      
      * update docstring for each classes
      
      * update bbox input dimension as standard 2 points and convert them to 4
      points in forward pass
      
      * update bros docs
      
      * apply suggestions from code review : update Bros -> BROS in bros.md
      
      * 1. box prefix var -> bbox
      2. update variable names to be more explicit
      
      * replace einsum with torch matmul
      
      * apply style and quality
      
      * remove unused argument
      
      * remove unused arguments
      
      * update docstrings
      
      * apply suggestions from code review: add BrosBboxEmbeddings, replace
      einsum with classical matrix operations
      
      * revert einsum update
      
      * update bros processor
      
      * apply suggestions from code review
      
      * add conversion script for bros
      
      * Apply suggestions from code review
      
      * fix readme
      
      * apply fix-copies
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      17fdd354
    • Joshua Lochner's avatar
      [Whisper] Fix word-level timestamps for audio < 30 seconds (#25607) · 95fe0f5d
      Joshua Lochner authored
      
      
      * Fix word-level timestamps for audio < 30 seconds
      
      * Fix code quality
      
      * fix unit tests
      
      * Fix unit tests
      
      * Fix unit test
      
      * temp: print out result
      
      * temp: set max diff to None
      
      * fix unit tests
      
      * fix typo
      
      * Fix typo
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * Use generation config for `num_frames`
      
      * fix docs
      
      * Move `num_frames` to kwargs
      
      * compute stride/attn_mask once
      
      * mark test as slow
      
      ---------
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      Co-authored-by: default avatarsanchit-gandhi <sanchit@huggingface.co>
      95fe0f5d
    • Sanchit Gandhi's avatar
      [MusicGen] Add sampling rate to config (#26136) · 44a0490d
      Sanchit Gandhi authored
      
      
      * [MusicGen] Add sampling rate to config
      
      * remove tiny
      
      * make property
      
      * Update tests/pipelines/test_pipelines_text_to_audio.py
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * style
      
      ---------
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      44a0490d
    • Dong-Yong Lee's avatar
      Fix beam search when using model parallel (#24969) · 8881f38a
      Dong-Yong Lee authored
      
      
      * Fix GPTNeoX beam search when using parallelize
      
      * Fix beam search idx device when using model parallel
      
      * remove onnx related stuff
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      
      * fix: move test_beam_search_on_multi_gpu to GenerationTesterMixin
      
      * fix: add right item to _no_split_modules of MegaPreTrainedModel
      
      * fix: add num_beams within parallelized beam_search test
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      ---------
      Co-authored-by: default avatarArthur <48595927+ArthurZucker@users.noreply.github.com>
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      8881f38a
    • Sanchit Gandhi's avatar
      [MusicGen] Add streamer to generate (#25320) · 0dd06c3f
      Sanchit Gandhi authored
      * [MusicGen] Add streamer to generate
      
      * add to for cond generation
      
      * add test
      
      * finish
      
      * torch only
      
      * fix type hint
      
      * yield audio chunks
      
      * fix typehint
      
      * remove test
      0dd06c3f
    • Matt's avatar
      Overhaul Conversation class and prompt templating (#25323) · 866df66f
      Matt authored
      
      
      * First commit while I figure this out
      
      * make fixup
      
      * Remove unused method
      
      * Store prompt attrib
      
      * Fix prompt argument for tests
      
      * Make same changes in fast tokenizer
      
      * Remove global prompts from fast tokenizer too
      
      * stash commit
      
      * stash commit
      
      * Migrate PromptConfig to its True Final Location
      
      * Replace Conversation entirely with the new class
      
      * Import/dependency fixes
      
      * Import/dependency fixes
      
      * Change format for lots of default prompts
      
      * More default prompt fixups
      
      * Revert llama old methods so we can compare
      
      * Fix some default configs
      
      * Fix some default configs
      
      * Fix misspelled kwarg
      
      * Fixes for Blenderbot
      
      * make fixup
      
      * little rebase cleanup
      
      * Add basic documentation
      
      * Quick doc fix
      
      * Truncate docstring for now
      
      * Add handling for the case when messages is a single string
      
      * Quick llama merges
      
      * Update conversational pipeline and tests
      
      * Add a couple of legacy properties for backward compatibility
      
      * More legacy handling
      
      * Add docstring for build_conversation_input_ids
      
      * Restructure PromptConfig
      
      * Let's start T E M P L A T I N G
      
      * Refactor all default configs to use templates instead
      
      * Revert changes to the special token properties since we don't need them anymore
      
      * More class templates
      
      * Make the sandbox even sandier
      
      * Everything replaced with pure templating
      
      * Remove docs for PromptConfig
      
      * Add testing and optional requirement boilerplate
      
      * Fix imports and make fixup
      
      * Fix LLaMA tests and add Conversation docstring
      
      * Finally get LLaMA working with the template system
      
      * Finally get LLaMA working with the template system
      
      * make fixup
      
      * make fixup
      
      * fmt-off for the long lists of test tokens
      
      * Rename method to apply_chat_template for now
      
      * Start on documentation
      
      * Make chat_template a property that reads through to the default if it's not set
      
      * Expand docs
      
      * Expand chat templating doc some more
      
      * trim/lstrip blocks by default and update doc
      
      * Few doc tweaks
      
      * rebase cleanup
      
      * Clarify docstring
      
      * rebase cleanup
      
      * rebase cleanup
      
      * make fixup
      
      * Quick doc edit
      
      * Reformat the standard template to match ChatML
      
      * Re-add PEFT check
      
      * Update docs/source/en/chat_templating.md
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      
      * Add apply_chat_template to the tokenizer doc
      
      * make fixup
      
      * Add doc links
      
      * Fix chat links
      
      * Fix chat links
      
      * Explain system messages in the doc
      
      * Add chat template test
      
      * Proper save-loading for chat template attribute
      
      * Add test skips for layout models
      
      * Remove _build_conversation_input_ids, add default_chat_template to code_llama
      
      * Make sure all LLaMA models are using the latest template
      
      * Remove default_system_prompt block in code_llama because it has no default prompt
      
      * Update ConversationPipeline preprocess
      
      * Add correct #Copied from links to the default_chat_templates
      
      * Remove unneeded type checking line
      
      * Add a dummy mark_processsed method
      
      * Reorganize Conversation to have **deprecated_kwargs
      
      * Update chat_templating.md
      
      * Quick fix to LLAMA tests
      
      * Small doc tweaks
      
      * Add proper docstrings and "copied from" statements to all default chat templates
      
      * Merge use_default_system_prompt support for code_llama too
      
      * Improve clarity around self.chat_template
      
      * Docstring fix
      
      * Fix blenderbot default template
      
      * More doctest fix
      
      * Break out some tokenizer kwargs
      
      * Update doc to explain default templates
      
      * Quick tweaks to tokenizer args
      
      * Cleanups for tokenizer args
      
      * Add note about cacheing
      
      * Quick tweak to the chat-templating doc
      
      * Update the LLaMA template with error checking and correct system message embedding
      
      * make fixup
      
      * make fixup
      
      * add requires_jinja
      
      * Cleanup to expected output formatting
      
      * Add cacheing
      
      * Fix typo in llama default template
      
      * Update LLaMA tests
      
      * Update documentation
      
      * Improved legacy handling in the Conversation class
      
      * Update Jinja template with proper error handling
      
      * Quick bugfix
      
      * Proper exception raising
      
      * Change cacheing behaviour so it doesn't try to pickle an entire Jinja env
      
      * make fixup
      
      * rebase cleanup
      
      ---------
      Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
      866df66f
    • Younes Belkada's avatar
      [`PEFT`] Fix PEFT + gradient checkpointing (#25846) · 7c63e6fc
      Younes Belkada authored
      * fix PEFT + gradient checkpointing
      
      * add disable RG
      
      * polish tests
      
      * fix comment
      
      * Revert "fix comment"
      
      This reverts commit b85386f50d2b104bac522e823c47b7e232116a47.
      
      * final explanations and tests
      7c63e6fc
    • Sanchit Gandhi's avatar
      [Whisper Tokenizer] Encode timestamps (#26054) · ac957f69
      Sanchit Gandhi authored
      * [Whisper Tokenizer] Fix tests after adding timestamps
      
      * fix s2t tokenizer tests
      
      * fix vocab test
      
      * backwards comp
      
      * fix tests
      
      * comment
      
      * style
      
      * fix last test
      
      * fix fast
      
      * make faster
      
      * move logic to decode
      
      * remove skip test
      
      * fix decode with offsets
      
      * fix special tokens
      
      * empty commit to re-trigger ci
      
      * use lru cache
      ac957f69
    • Sam Denton's avatar
      Fix eval accumulation when `accelerate` > 0.20.3 (#26060) · 6d49b9dc
      Sam Denton authored
      As mentioned in: https://github.com/huggingface/transformers/issues/25641
      
      Eval accumulation will never happen with `accelerate > 0.20.3`, so this change ensures that `sync_gradients` is ignored if accelerate is > 0.20.3
      6d49b9dc
    • Craig Chan's avatar
      Add missing Maskformer dataclass decorator, add dataclass check in ModelOutput... · d7bd325b
      Craig Chan authored
      
      Add missing Maskformer dataclass decorator, add dataclass check in ModelOutput for subclasses (#25638)
      
      * Add @dataclass to MaskFormerPixelDecoderOutput
      
      * Add dataclass check if subclass of ModelOutout
      
      * Use unittest assertRaises rather than pytest per contribution doc
      
      * Update src/transformers/utils/generic.py per suggested change
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      
      ---------
      Co-authored-by: default avataramyeroberts <22614925+amyeroberts@users.noreply.github.com>
      d7bd325b
  4. 13 Sep, 2023 15 commits
  5. 12 Sep, 2023 2 commits