Skip to content
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

BERT Inference Demo using pytorch #42

Closed
HerbJiang opened this issue Mar 31, 2020 · 4 comments
Closed

BERT Inference Demo using pytorch #42

HerbJiang opened this issue Mar 31, 2020 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@HerbJiang
Copy link

Description

Could you provide an jupyter notebook sample for BERT inference demo using pytorch?
Just like current BERT inference demo using mxnet

Who will benefit from this feature?

People already pretrained / fine-tuned their own model using pytorch can easily migrate into this project.

Thanks.

@stu1130 stu1130 added the enhancement New feature or request label Mar 31, 2020
@lanking520
Copy link
Member

Currently, we can only do PyTorch Traced model. There are a few examples that may allow us import in DJL:

TorchHub example

thirdparty popular BERT pretrained model

If you are interested, please feel free to search for a BERT pretrained model. You can tested it out using DJL with Jupyter Notebook and help us grow the model zoo! :)

@stu1130 stu1130 self-assigned this Apr 1, 2020
@stu1130
Copy link
Contributor

stu1130 commented Apr 10, 2020

Hey @HerbJiang,
I have uploaded the HuggingFace Bert Question Answering Model. You can try it out with

git clone https://github.com/awslabs/djl.git
cd djl
./gradlew :examples:run -Dmain=ai.djl.examples.inference.BertQaInference -Dai.djl.default_engine=PyTorch

The source code is here and translator implementation.
I am working on the jupyter notebook, stay tuned

@stu1130
Copy link
Contributor

stu1130 commented Apr 15, 2020

@HerbJiang
I completed the pytorch BERT QA jupyter notebook.
You can use it with your pretrained BERT along with vocabulary from HuggingFace.
Remember to convert your model to TorchScript.
If you need any help, please let us know.

@stu1130
Copy link
Contributor

stu1130 commented Apr 16, 2020

feel free to open the issue, if you have any question

@stu1130 stu1130 closed this as completed Apr 16, 2020
aksrajvanshi added a commit to aksrajvanshi/djl that referenced this issue Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants