- 26 Nov, 2024 11 commits
-
-
Fanli Lin authored
use full path for run_qa.py
-
Fanli Lin authored
add device-agnostic API Signed-off-by:
Lin, Fanli <fanli.lin@intel.com>
-
Ahmed Almaghz authored
* Add docs/source/ar/benchmarks.md to Add_docs_source_ar_benchmarks.md * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update docs/source/ar/benchmarks.md Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com> * Update _toctree.yml * Update benchmarks.md --------- Co-authored-by:
Abdullah Mohammed <554032+abodacs@users.noreply.github.com>
-
vansin authored
Update Python Version
-
Joshua Lochner authored
* Fix torch.onnx.export of Qwen2-VL vision encoder This PR fixes onnx export support for the vision encoder of Qwen2-VL, which converts the `cu_seqlens` to `torch.int32`, leading to errors later on when using the values for slicing. https://github.com/huggingface/transformers/blob/c57eafdaa119eecae8557be4c626629bc1adc0fd/src/transformers/models/qwen2_vl/modeling_qwen2_vl.py#L1044-L1046 ## Error: ``` onnx.onnx_cpp2py_export.shape_inference.InferenceError: [ShapeInferenceError] (op_type:Slice, node name: /blocks.0/attn/Slice_4): axes has inconsistent type tensor(int64) ``` ## Code to reproduce issue: ```py import requests from PIL import Image import torch from transformers import ( AutoProcessor, Qwen2VLForConditionalGeneration, ) # Constants VISION_MODEL_NAME = "vision_encoder.onnx" # Load model and processor model_id = "hf-internal-testing/tiny-random-Qwen2VLForConditionalGeneration" model = Qwen2VLForConditionalGeneration.from_pretrained(model_id).eval() processor = AutoProcessor.from_pretrained(model_id) # Prepare inputs url = "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg" image = Image.open(requests.get(url, stream=True).raw) conversation = [ { "role": "user", "content": [ { "type": "image" }, { "type": "text", "text": "Describe this image."}, ], }, ] images = [image] text_prompt = processor.apply_chat_template(conversation, add_generation_prompt=True) inputs = processor(text=[text_prompt], images=images, padding=True, return_tensors="pt") ## Vision model vision_inputs = dict( pixel_values=inputs["pixel_values"], grid_thw=inputs["image_grid_thw"], ) vision_inputs_positional = tuple(vision_inputs.values()) vision_outputs = model.visual.forward(*vision_inputs_positional) # Test forward pass torch.onnx.export( model.visual, args=vision_inputs_positional, f=VISION_MODEL_NAME, export_params=True, opset_version=14, do_constant_folding=True, input_names=list(vision_inputs.keys()), output_names=["image_features"], dynamic_axes={ "pixel_values": { 0: "batch_size * grid_t * grid_h * grid_w", 1: "channel * temporal_patch_size * patch_size * patch_size", }, "grid_thw": {0: "batch_size"}, "image_features": {0: "batch_size * grid_t * grid_h * grid_w"}, }, ) # Load and check the exported model model import onnx model = onnx.load(VISION_MODEL_NAME) onnx.checker.check_model(model, full_check=True) inferred = onnx.shape_inference.infer_shapes(model, check_type=True) ``` * Formatting * [run-slow] qwen2_vl
-
Matt authored
* Initial draft * Add .jinja file loading for processors * Add processor saving of naked chat template files * make fixup * Add save-load test for tokenizers * Add save-load test for tokenizers * stash commit * Try popping the file * make fixup * Pop the arg correctly * Pop the arg correctly * Add processor test * Fix processor code * stash commit * Processor clobbers child tokenizer's chat template * Processor clobbers child tokenizer's chat template * make fixup * Split processor/tokenizer files to avoid interactions * fix test * Expand processor tests * Rename arg to "save_raw_chat_template" across all classes * Update processor warning * Move templates to single file * Move templates to single file * Improve testing for processor/tokenizer clashes * Improve testing for processor/tokenizer clashes * Extend saving test * Test file priority correctly * make fixup * Don't pop the chat template file before the slow tokenizer gets a look * Remove breakpoint * make fixup * Fix error
-
Yuxuan.Zhang authored
* change apply_rotary_pos_emb * upload for glm-edge * remove useless part * follow the suggestion * fix * format * format * test * format again * format again * remove modular change * remove modular change * this apply_rotary_pos_emb need modify? * fix with this * format * format * ruff check * modify modular_glm failed * remove partial_rotary_factor of function partial_rotary_factor * fix wrong change of examples/research_projects * revert * remove line 118 * use q_rot
-
Vladislav Bronzov authored
add base tp support
-
eustlb authored
* fix test_tiny_timestamp_generation * fix test_large_timestamp_generation * fix test_whisper_shortform_single_batch_prev_cond * fix test_whisper_shortform_multi_batch_hard_prev_cond * return_timestamps necessary with long form * fix test_default_multilingual_transcription_long_form * fix test_tiny_token_timestamp_generation_longform * fix test_whisper_longform_multi_batch_hard * Update tests/models/whisper/test_modeling_whisper.py Co-authored-by:
Yoach Lacombe <52246514+ylacombe@users.noreply.github.com> * fix typo * do not expect special tokens * fix test_whisper_longform_single_batch_beam * fix test_whisper_longform_multi_batch_hard_prev_cond * update test_whisper_longform_multi_batch_hard_prev_cond * update test_whisper_longform_multi_batch_hard_prev_cond * these tests does not make sense anymore * this test does not make sense anymore * make fixup * suggested nits * add test with forced_decoder_ids * this test does not make sense anymore * change assert for unittest test cases * make fixup * test with prompt_ids and task and language * fix unittest test case call * fix test_tiny_generation * fix test_tiny_en_generation * fix test_tiny_en_batched_generation * fix test_tiny_longform_timestamps_generation * fix test_tiny_timestamp_generation * fix test_large_generation * fix test_large_batched_generation * fix test_large_generation_multilingual * fix test_large_timestamp_generation * fix test_large_timestamp_generation * fix test_tiny_token_timestamp_generation_longform * fix test_tiny_en_batched_generation * make fixup * [run-slow] whisper --------- Co-authored-by:
Yoach Lacombe <52246514+ylacombe@users.noreply.github.com>
-
Mohamed Mekkouri authored
-
Raushan Turganbay authored
add default values
-
- 25 Nov, 2024 25 commits
-
-
Yoni Gozlan authored
* Fix import structure image_processor_fast * update to new inits
-
xuzifei-dmatrix authored
* making gpt2 fx tracable * running make fix-copies * Revert "running make fix-copies" This reverts commit 5a3437cb5b63799243bceae7d21a2aed8d0418c7.
-
Viktor Scherbakov authored
* Updated documentation and added conversion utility * Update docs/source/en/tiktoken.md Co-authored-by:
Steven Liu <59462357+stevhliu@users.noreply.github.com> * Update docs/source/en/tiktoken.md Co-authored-by:
Steven Liu <59462357+stevhliu@users.noreply.github.com> * Moved util function to integration folder + allow for str * Update formatting Co-authored-by:
Arthur <48595927+ArthurZucker@users.noreply.github.com> * Updated formatting * style changes --------- Co-authored-by:
Steven Liu <59462357+stevhliu@users.noreply.github.com> Co-authored-by:
Arthur <48595927+ArthurZucker@users.noreply.github.com>
-
Mohamed Mekkouri authored
fix_test
-
Mohamed Mekkouri authored
* Upgrade Torch 2.5 * uncomment
-
Yih-Dar authored
fix Co-authored-by:
ydshieh <ydshieh@users.noreply.github.com>
-
jiqing-feng authored
* fix gptj data type missmatch Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * add low precision static cache tests Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * fix format Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * fix low-precision static cache tests * fix format Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * avoid config change Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * change data type convert in cache copy Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * fix comment Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> * cast key value after k v out Signed-off-by:
jiqing-feng <jiqing.feng@intel.com> --------- Signed-off-by:
jiqing-feng <jiqing.feng@intel.com>
-
Benjamin Bossan authored
The old AWQ version is failing with the latest (unreleased) transformers, giving the error: > ImportError: cannot import name 'shard_checkpoint' from 'transformers.modeling_utils' This has been resolved in awq v0.2.7: https://github.com/casper-hansen/AutoAWQ/pull/644
-
Mohamed Mekkouri authored
* fix_tests_bitnet * fix format
-
Shane A authored
* Rename/move OLMo Nov files to OLMo2 * Rename Olmo1124 and its variants to Olmo2
-
dependabot[bot] authored
Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.4.1 to 6.4.2. - [Changelog](https://github.com/tornadoweb/tornado/blob/v6.4.2/docs/releases.rst) - [Commits](https://github.com/tornadoweb/tornado/compare/v6.4.1...v6.4.2 ) --- updated-dependencies: - dependency-name: tornado dependency-type: direct:production ... Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
Jacky Lee authored
* fix: qwen2 model ids * fix: line * fix: more format * update: reformat
-
Tom Aarsen authored
* Given that self.active_adapter is deprecated, avoid using it * Remove misleading comment - `self.active_adapter` is not used (and deprecated)
-
Donald Szeto authored
* Fix convert_tokens_to_string when decoder is None * revert unrelated changs --------- Co-authored-by:
Arthur Zucker <arthur.zucker@gmail.com>
-
wanxiangchwng authored
Signed-off-by:
wanxiangchwng <cui.shuang@foxmail.com>
-
dependabot[bot] authored
Bump tornado in /examples/research_projects/visual_bert Bumps [tornado](https://github.com/tornadoweb/tornado) from 6.4.1 to 6.4.2. - [Changelog](https://github.com/tornadoweb/tornado/blob/v6.4.2/docs/releases.rst) - [Commits](https://github.com/tornadoweb/tornado/compare/v6.4.1...v6.4.2 ) --- updated-dependencies: - dependency-name: tornado dependency-type: direct:production ... Signed-off-by:
dependabot[bot] <support@github.com> Co-authored-by:
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
-
Meliksah Turker authored
contiguous() is called before view() for key and value within prepare_fa2_from_position_ids function
-
VictorAtIfInsurance authored
* allow unused parameter passthrough when chunking in asr pipelines * format code * format * run fixup * update tests * update parameters to pipline in test * updates parametrs in tests * change spelling in gitignore * revert .gitignore to main * add git ignore of devcontainer folder * assert asr output follows expected inference output type * run fixup * Remove .devcontainer from .gitignore * remove compliance check
-
kang sheng authored
* sum gathered input tokens * ruff line-length is 119, format the code --------- Co-authored-by:
kangsheng <kangsheng@meituan.com>
-
Raushan Turganbay authored
fix base prefix
-
Arthur authored
* some modification for roadmap * revert some changes * yups * weird * make it work * sttling * fix-copies * fixup * renaming * more fix-copies * move stuff around * remove torch script warnings * ignore copies * revert bad changes * woops * just styling * nit * revert * style fixup * nits configuration style * fixup * nits * will this fix the tf pt issue? * style * ??????? * update * eval? * update error message * updates * style * grumble grumble * update * style * nit * skip torch fx tests that were failing * style * skip the failing tests * skip another test and make style
-
Raushan Turganbay authored
* fix blip generation * dont remove it yet * Update src/transformers/models/blip_2/modeling_blip_2.py Co-authored-by:
Arthur <48595927+ArthurZucker@users.noreply.github.com> * address comments * modular --------- Co-authored-by:
Arthur <48595927+ArthurZucker@users.noreply.github.com>
-
Raushan Turganbay authored
* fix * fix tests * fix copies * add docs * Revert "add docs" This reverts commit 32d35634f12ba02781d2ebdee0c8dcfbe992a7b9. * qwen move deltas * mllama can potentiall fullgraph compile * enable mllama compile and fix tests * remove mllama fixes
-
Dmitry Rogozhkin authored
Starting from version 2.4 PyTorch introduces a stricter check for the objects which can be loaded with torch.load(). Starting from version 2.6 loading with weights_only=True requires allowlisting of such objects. This commit adds allowlist of some numpy objects used to load model checkpoints. Usage is restricted by context manager. User can still additionally call torch.serialization.add_safe_globals() to add other objects into the safe globals list. Accelerate library also stepped into same problem and addressed it with PR-3036. Fixes: #34631 See: https://github.com/pytorch/pytorch/pull/137602 See: https://pytorch.org/docs/stable/notes/serialization.html#torch.serialization.add_safe_globals See: https://github.com/huggingface/accelerate/pull/3036 Signed-off-by:
Dmitry Rogozhkin <dmitry.v.rogozhkin@intel.com>
-
jeongin601 authored
* modeling nemotron kv caching bugfix Signed-off-by:
jeongin601 <0200angela@gmail.com> * test file deleted Signed-off-by:
jeongin601 <0200angela@gmail.com> * code refinement Signed-off-by:
jeongin601 <0200angela@gmail.com> * remove unused variables Signed-off-by:
jeongin601 <0200angela@gmail.com> * import block sorted * removed deprecation warning Signed-off-by:
jeongin601 <0200angela@gmail.com> * removed support for tuple shape past_key_values Signed-off-by:
jeongin601 <0200angela@gmail.com> * Update conditional statement for cache initialization Co-authored-by:
Arthur <48595927+ArthurZucker@users.noreply.github.com> --------- Signed-off-by:
jeongin601 <0200angela@gmail.com> Co-authored-by:
Arthur <48595927+ArthurZucker@users.noreply.github.com>
-
- 22 Nov, 2024 4 commits
-
-
Yoni Gozlan authored
* add fix and examples * fix camel case naming
-
Mohamed Mekkouri authored
small test fix
-
Benjamin Bossan authored
* CI Skip EETQ tests while package is broken EETQ tries to import the shard_checkpoint function from transformers but the function has been removed. Therefore, trying to use EETQ currently results in an import error. This fix results in EETQ tests being skipped if there is an import error. The issue has been reported to EETQ: https://github.com/NetEase-FuXi/EETQ/issues/34 * Raise helpful error when trying to use eetq * Forget to raise the error in else clause
-
Andrés Marafioti authored
* smol improvements to support more flexible usage * ruff
-