1. 17 Jun, 2024 11 commits
  2. 14 Jun, 2024 10 commits
  3. 13 Jun, 2024 5 commits
  4. 12 Jun, 2024 11 commits
  5. 11 Jun, 2024 3 commits
    • Jade Choghari's avatar
      35a6d9d6
    • 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