Граф коммитов

109 Коммитов

Автор SHA1 Сообщение Дата
Wenbing Li aa2c82fa67
Add the MLlama Imaging Processing Support (#823)
* initial checkins for mllama image process

* fix some tests

* some fixings

* add more image

* More test assertions

* parity test passed

* code clean up

* code refinement
2024-10-22 14:24:09 -07:00
Wenbing Li 1b80794903
Remove OpenCV dependency from C_API mode (#800)
* Remove OpenCV dependency from C_API model

* fix build on Windows

* switch ci build flag

* try to fix the macOS build issue

* more fixing

* fix the macOS build issue

* list jpeg source

* verified on MacOS

* update the pp_api too

* avoid the codecs library conflicts

* Add the unit tests

* move the codec test

* add the missing dl lib for extensions test

* refine the code

* a smaller fixing for Windows Python
2024-09-04 16:50:05 -07:00
Wenbing Li 2d02a687be
Optimize the tokenizer for efficiency (#797)
* optimize the tokenizer for efficiency

* fix the unit test failures.

* fix the api test case failures

* removed the unused code.

* More test cases fixings

* One more fixing

* fix macOS build issues

* refine the test

* add more diagnosis info.

* fix unit test in CI Linux

* fix the pp_api test failure
2024-08-27 18:57:50 -07:00
Wenbing Li 8f2c35fad0
Add more tests for pre-processing C APIs (#793)
* initial api for tokenizer

* More fixings and test data refinement

* add a simple wrapper for pre-processing APIs

* fix the test issues

* test if the tokenizer is spm based

* fix the failed test cases

* json pointer does not work
2024-08-21 16:48:39 -07:00
Wenbing Li 620050fbe0
reimplement resize cpu kernel for image processing (#768)
* reimplement resize cpu kernel for image processing

* accuracy fixing and code refinement

* fix the build issues

* fix Linux build issue

* more fixings

* Fix the pipeline issue

* fix the ci script

* try to fix CUDA machine pool
2024-07-23 15:40:52 -07:00
Wenbing Li 8153bc1a3a
Feature extraction C API for whipser model (#755)
* Feature extraction C API for whipser model

* Update the docs

* Update the docs2

* refine the code

* fix some issues

* fix the Linux build

* fix more data consistency issue

* More code refinements
2024-07-11 11:20:36 -07:00
cao lei 95d65e4ec0
sync to flash attention kernel 2.5.9 and add document of how to write custom op (#757)
* sync to flash attention kernel 2.5.9

* support users to overload GetMayInplace and ReleaseMayInplace

* Undo the change for pybind11 dependency
2024-07-10 07:09:40 -07:00
Wenbing Li 00a594f13d
Standardize the inputs for ONNX STFT op for Whisper model (#681)
* Standardize the inputs for ONNX STFT op for Whisper model

* undo the format change

* Update _torch_cvt.py
2024-03-29 11:13:30 -07:00
Kaz Nishimura 31f129c779
Improve handling of missing `vocab_file` attribute in HFTokenizerConverter (#677)
This commit updates `HFTokenizerConverter` to handle cases where the `hf_tokenizer` object might not have a `vocab_file` attribute.

Changes:

* Uses `getattr` to retrieve the `vocab_file` attribute for flexibility
* Stores the retrieved value in a separate variable `vocab_file` for clarity
* Checks if `vocab_file` is `None` before checking its existence

This ensures the converter works correctly even with tokenizers that don't define a `vocab_file` attribute.
2024-03-26 08:56:28 -07:00
Wenbing Li 6ac6fb6fbd
using the huggingface whisper config instead of fixed numbers (#667)
* using the huggingface whisper config instead of fixed numbers

* refactor a little bit
2024-03-06 14:29:49 -08:00
Wenbing Li 61369fb970
Unify the spm/bpe tokenizers (#666)
* Unify the spm/bpe tokenizers

* fix the build error

* fix the decoding issue

* add model name in exported onnx

* fixing the unit tests

* revert the unneccesary file format changes
2024-03-06 10:07:05 -08:00
Wenbing Li b045e66396
make onnx package to be optional. (#653)
* putting onnx package to be optional

* update the ci.yml

* add more message of missing ONNX package
2024-02-15 14:09:04 -08:00
Wenbing Li a32b932547
add a gen_processing_model option to cast token-id for int64 (#632)
* add a gen_processing_model option to cast token-id for int64

* Update util.py

test pipeline trigger
2024-01-12 10:15:18 -08:00
Scott McKay da9c01d3e1
Add support for YOLO v8 Pose post-processing. (#605)
* Add support for YOLO v8 Pose post-processing.

The output has additional values in the 'mask' data for the keypoints.

- Update the post processing steps to support extracting and scaling the keypoints.
- Simplify the existing step to split out the boxes and scores by using a basic Split operator if there is no confidence score for a bounding box to apply to the class scores.
  - Confidence score for a bounding box is YOLO versions prior to 8.
- Update existing tests

TODO: Add unit tests for new Steps. They have been manually validated with the real model for now.

* Changes to support pre-decoded input.

Needs cleanup.

* Support an overall max number of detections as well as per-class detections.

* Expand Identity to support multiple inputs
Fix issue with incorrect score being selected by NMS (was max and not score for selected clas)
Fix TopK usage so result ordering is consistent when it is not used
Add unit tests.

* Update docs and some cleanups

* Use Union
2023-12-20 08:51:29 +10:00
Wenbing Li fb2a8c2841
Enhancing CUDA Support in Python Package Build and Testing (#608)
* initial commit

* Add the cuda support for python package

* formt the code

* refine it a little bit
2023-11-27 15:39:52 -08:00
Rachel Guo 73e69bb779
Make `token_type_ids` optional output for HFBertTokenizer op (#583)
* add initial changes for optional outpout for berttokenizer

* add test tokenizer onnx model

* update

* fix

* remove commented out code

* fix extend list elements

* fix

* minor update

* test

* return optional in outputcharacteristic

* update

* update

* debug

* fix flag

* remove print msg

* minor update

* update comments

* update pr comments

* minor update

* minor update

* fix

---------

Co-authored-by: rachguo <rachguo@rachguos-Mac-mini.local>
Co-authored-by: Sayan Shaw <52221015+sayanshaw24@users.noreply.github.com>
Co-authored-by: rachguo <rachguo@rachguos-Mini.attlocal.net>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
2023-11-09 18:38:50 -08:00
Scott McKay 989bf85314
Better update to YOLO post-processing addition (#598)
* Run strict shape inferencing and save the model without the unnecessary ValueInfo entries

* Make comment clearer
2023-11-10 10:22:38 +10:00
Danylo Ulianych 7a29cdf702
Fixed a bug (typo) in yolo_detection (#595)
I'm only learning onnxruntime extension but this seems to me like a typo.

Co-authored-by: Wenbing Li <10278425+wenbingl@users.noreply.github.com>
2023-11-08 12:59:11 -08:00
Wenbing Li d1148aea4e
Support 'added_token' attribute for BPE tokenizer and some code refactoring. (#591)
* Fix CodeGenTokenizer issues and the related code refactoring.

* refactor the trie-tree

* temp check-ins

* code complete

* correctness fixing

* Update _hf_cvt.py

* more test cases fixing

* more refinement

* linux crash fixing

* Update test_autotokenizer.py
2023-11-04 22:56:26 -07:00
Wenbing Li 68b9d1dc47
Fix the exception on invalid trie-tokenizer input (#575)
* fix the exception on invalid trie-tokenizer input

* remove unused import
2023-10-16 17:03:02 -07:00
Sayan Shaw bcde705eec
Close gap in vocab for AutoTokenizer support for GPT4Tokenizer (#567)
Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-10-03 12:48:14 -07:00
Sam Webster b7e35a1a34
Add token indices output to sentencepiece (#566)
* Add token_indices

* Update test (not tested)

* Address comments

* Change output to optional and fix reverse

* indices test

* Switch param order

---------

Co-authored-by: Sayan Shaw <52221015+sayanshaw24@users.noreply.github.com>
2023-10-03 09:56:28 -07:00
Wenbing Li e899da29d2
add more hf models into converter APIs (#562) 2023-09-18 14:38:32 -07:00
Sayan Shaw 169438999c
Add support for Fairseq models (like XLMRobertaTokenizer) (#556)
* add XLMRobertaTokenizer support

* update as per comments

* change optional dereference for macos

* typo

---------

Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-09-08 17:03:22 -07:00
Wenbing Li 396044310e
Add more HF tokenizer supports in gen_processing_models (#531) 2023-08-18 17:09:22 -07:00
Wenbing Li ee14fbe48e
correct CLIP tokenizer name (#526) 2023-08-16 12:51:17 -07:00
Sayan Shaw 9ba649e134
Fix HF Fast Tokenizer cvt issue for AutoTokenizer imp (#520)
* Fix GPT2 and Falcon tokenizer cvt for AutoTokenizer imp

* fix fast tokenizer issue

* small fix

* use slow tokenizer in test script

---------

Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-08-11 13:17:56 -07:00
Wenbing Li 978ada6d60
Add TrieTokenizer for RWKV-like LLM models (#509)
* Add TrieTokenizer for RWKV-like LLM models

* add more tests

* fix the windows build

* downloading file instead of check in the vocab file

* a small bug fixing
2023-08-08 16:47:38 -07:00
Sayan Shaw 997e9ee007
Add Falcon-7b and Falcon-40b tokenizer support (#510)
* Add Falcon-7b and Falcon-40b tokenizer support

* fix alignment and add tokenizer file in test/data to speed up compute

---------

Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-08-07 14:37:57 -07:00
Wenbing Li 922b7cc387
Add Bert tokenizer in the supported model list and code refinement (#503)
* Add Bert tokenizer in the supported model list and the related code refinement

* utest fix
2023-08-02 14:01:36 -07:00
Wenbing Li b8bac85ecd
Add Llama and Llama 2 tokenization supports (#499) 2023-07-26 10:22:00 -07:00
Wenbing Li 62d8598b6b
Update whisper model test cases and e2e example (#496)
* Update whisper model test cases and e2e example

* fix unit test on windows

* more refinement

* utest fix
2023-07-21 15:27:02 -07:00
Wenbing Li 981cb049ff
Add a new API for building data processing graph from Huggingface transformers processor/tokenizer (#482)
* initial checkins

* test pass

* basic impl

* first unit test pass

* merge error

* refine a little bit

* add more unit test

* fix unit test

* Fix the unit test.

* add one more whisper audiodecoder test case

* update the docs

* More updates
2023-07-17 16:50:58 -07:00
JiCheng 5d480a8c5d
clip_image_processor (#478)
* clip_image_processor
separate clip ppp

---------

Co-authored-by: Scott McKay <skottmckay@gmail.com>
2023-07-12 17:52:17 +08:00
Sayan Shaw d876f7ff82
Initial BertTokenizer offset mapping implementation (#477)
* Initial BertTokenizer offset mapping implementation

* minor change

---------

Co-authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-07-03 15:17:23 -07:00
Wenbing Li 93f239c143
Unit test being compatible with ONNXRuntime-GPU package, and some clean-ups. (#457) 2023-05-30 11:01:30 -07:00
Scott McKay 64f20828ce
Handle ONNX 1.14 in test scripts (#435)
* Calculate and specify ir_version so we use the oldest possible for maximum compatibility

* Don't use `ignore_unknown` in call to `find_min_ir_version_for` as it's only supported in the most recent ONNX release.
2023-05-12 07:13:37 +10:00
Vishal Jain 03b96c822c
Fix ReadMe : Example usage of the PrePostProcessor.md (#436)
- Small typo fix in "Add post-processing steps"
2023-05-11 18:36:14 +10:00
Wenbing Li 43994eb34a
Fix the unit test failure with ONNX 1.14 package. (#428)
* Fix the unit test failure with ONNX 1.14 package.

* more tests

* Update whisper_e2e.py
2023-05-08 11:37:54 -07:00
Wenbing Li 46efcb9051
PyOp attribute supports int and float data type (#425) 2023-05-05 19:35:59 -07:00
Wenbing Li 2fa0b710ea
Adding down-sampling and stereo mixing features for AudioDecoder (#420)
* initial draft

* second

* third

* polishing

* fix the M_PI name in LINUX platform

* fix bessel function issue

* add a unit test case

* fix the unit test name
2023-05-04 13:30:10 -07:00
Wenbing Li 0f45fef2d9
Compatible with onnxruntime-gpu package (#410)
* be compatible without onnxruntime-gpu version

* some fixing
2023-04-26 17:17:23 -07:00
Wenbing Li 997fa892c2
more code fixing related whisper models (#403) 2023-04-21 09:26:44 -07:00
JiCheng db87dc416d
[object detection ppp] YoLo as example (#397)
* object detection
* Unit test
add e2e fastestdet model test

---------

Co-authored-by: Changming Sun <chasun@microsoft.com>
Co-authored-by: Scott McKay <skottmckay@gmail.com>
2023-04-20 13:34:11 +08:00
Wenbing Li adb8efd62b
support batch > 1 in BpeDecoder (#400)
* support batch > 1 in BpeDecoder

* update the shape in helper function
2023-04-19 14:28:56 -07:00
Wenbing Li 711774db6b
Add a merge step in whisper end-to-end script and fixed some issues (#399)
* add merged models in whisper model

* verify the final model
2023-04-17 16:37:06 -07:00
JiCheng 154ead35a3
built-in bounding box op (#382)
* built-in bounding box op
* update boundary check
* assert policy
* more boundary test and check
* XYXY--> X horizon
---------

Co-authored-by: Scott McKay <skottmckay@gmail.com>
2023-04-12 19:35:53 +08:00
Wenbing Li b5dce955f0
Add an audio decoder custom op for whisper end-to-end processing (#385)
* evaluate the audio decoder library

* MP3 Decoder

* rename it to test_audio_codec

* add the audio decoder to whisper model

* whisper end-to-end draft

* fix the mp3 decoder

* Running with ONNX models

* Add more audio format supports

* refine the end-to-end script

* Update operators/audio/audio_decoder.hpp

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* Update operators/audio/audio_decoder.hpp

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* Update operators/audio/audio_decoder.hpp

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

* some fixings of comments and more test cases.

* changes for review comments.

* Update audio_decoder.hpp

* Update audio_decoder.hpp

* code refinement

* Update operators/audio/audio_decoder.hpp

Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>

---------

Co-authored-by: Sayan Shaw <52221015+sayanshaw24@users.noreply.github.com>
Co-authored-by: Edward Chen <18449977+edgchen1@users.noreply.github.com>
2023-04-11 14:47:10 -07:00
Wenbing Li 9cd1284da8
Pre and Post processing example for openAI Whisper model (#380)
* add a stft-norm custom op for log-mel spectrum.

* undo the debug change

* Support ONNX standard STFT op signature.

* Add a unit test onnx STFT compatible mode.

* add whisper pre-/post- processing example

* Update dlib.cmake

* undo test code changes

* Update setup.cfg

* update the end2end example with STFT op
2023-03-30 13:44:50 -07:00
Sayan Shaw 8b2af20b46
Update CLIPTokenizer cvt for added offset mapping output (#384)
Authored-by: Sayan Shaw <sayanshaw@microsoft.com>
2023-03-23 23:52:58 -07:00