deepjavalibrary / djl

An Engine-Agnostic Deep Learning Framework in Java
https://djl.ai
Apache License 2.0
4.13k stars 656 forks source link

[Question] Any plans to support HuggingFace Pipelines? #2191

Closed conker84 closed 1 year ago

conker84 commented 1 year ago

Hi guys I was wondering if there are any plans to support HuggingFace Pipelines?

https://huggingface.co/docs/transformers/v4.24.0/en/main_classes/pipelines#transformers.pipeline

Maybe I can contribute to that, but I need some guidance about where to start... Thank you so much

frankfliu commented 1 year ago

We already support the following use case:

  1. fill-mask: https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/tokenizers/TranslatorTest.java#L167-L188
  2. questing-answering: https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/tokenizers/TranslatorTest.java#L86-L102
  3. token-classification: https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/tokenizers/TranslatorTest.java#L261-L281
  4. text-embedding: https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/tokenizers/TranslatorTest.java#L261-L281
  5. text-classification: https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/tokenizers/TranslatorTest.java#L261-L281

Let me know which task you are interested in to contribute.

frankfliu commented 1 year ago

We also have built-in model zoo for huggingface, see: https://github.com/deepjavalibrary/djl/blob/master/extensions/tokenizers/src/test/java/ai/djl/huggingface/zoo/ModelZooTest.java#L48

frankfliu commented 1 year ago

Feel free to reopen the issue if you have further questions.