-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ONNX Support #346
Merged
Merged
ONNX Support #346
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # src/pipelines/translation/translation_pipeline.rs
… optional du to their size
Pending publication of changes introduced in LaurentMazare/tch-rs#662 and update of the |
news about this? |
# Conflicts: # CHANGELOG.md # Cargo.toml # src/pipelines/common.rs # src/pipelines/masked_language.rs # src/pipelines/question_answering.rs # src/pipelines/sequence_classification.rs # src/pipelines/summarization.rs # src/pipelines/text_generation.rs # src/pipelines/token_classification.rs # src/pipelines/zero_shot_classification.rs
# Conflicts: # CHANGELOG.md # Cargo.toml # src/bart/bart_model.rs # src/fnet/attention.rs # src/gpt2/gpt2_model.rs # src/gpt_j/gpt_j_model.rs # src/gpt_neo/gpt_neo_model.rs # src/longt5/longt5_model.rs # src/m2m_100/m2m_100_model.rs # src/marian/marian_model.rs # src/mbart/mbart_model.rs # src/openai_gpt/openai_gpt_model.rs # src/pegasus/pegasus_model.rs # src/pipelines/generation_utils.rs # src/pipelines/masked_language.rs # src/pipelines/sentence_embeddings/pipeline.rs # src/pipelines/sequence_classification.rs # src/pipelines/summarization.rs # src/pipelines/text_generation.rs # src/pipelines/translation/translation_pipeline.rs # src/prophetnet/prophetnet_model.rs # src/reformer/attention.rs # src/reformer/reformer_model.rs # src/t5/t5_model.rs # src/xlnet/xlnet_model.rs # tests/fnet.rs # tests/longformer.rs # tests/mobilebert.rs
# Conflicts: # src/bart/bart_model.rs # src/common/error.rs # src/common/resources/mod.rs # src/gpt2/gpt2_model.rs # src/gpt_j/gpt_j_model.rs # src/gpt_neo/gpt_neo_model.rs # src/longt5/longt5_model.rs # src/m2m_100/m2m_100_model.rs # src/marian/marian_model.rs # src/mbart/mbart_model.rs # src/openai_gpt/openai_gpt_model.rs # src/pegasus/pegasus_model.rs # src/pipelines/masked_language.rs # src/pipelines/question_answering.rs # src/pipelines/sequence_classification.rs # src/pipelines/token_classification.rs # src/pipelines/zero_shot_classification.rs # src/prophetnet/prophetnet_model.rs # src/reformer/reformer_model.rs # src/t5/t5_model.rs # src/xlnet/xlnet_model.rs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Further changes:
decoder_start_token_id
from the provided configuration rather than using a hard-coded default valueLanguageGenerator
and pipelines functionsfloat
,half
,set_device
toResult<(), RustBertError>
as these become fallible for ONNX modelsConfig
objects into anEnum
to allow handling both torch-based and ONNX models.The
model_resources
field now needs to be wrapped in the corresponding enum variant, e.g.model_resources: ModelResources::TORCH(model_resource)
for Torch-based modelsforced_bos_token_id
andforced_eos_token_id
fields to text generation models.If these are not None, this will trigger a forced BOS/EOS token generation at the first of
max_length
positions (aligns with the Pytorch Transformers library)Fixes #292