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

Add unit tests #29

Open
MahmoudWahdan opened this issue Nov 3, 2020 · 4 comments
Open

Add unit tests #29

MahmoudWahdan opened this issue Nov 3, 2020 · 4 comments
Assignees
Labels
feature Request for new feature

Comments

@MahmoudWahdan
Copy link
Owner

Add unit tests

@MahmoudWahdan MahmoudWahdan added the feature Request for new feature label Nov 3, 2020
@MahmoudWahdan MahmoudWahdan self-assigned this Nov 3, 2020
@deathsurgeon1
Copy link

@MahmoudWahdan How to do inferencing from tflite compressed model??

@MahmoudWahdan
Copy link
Owner Author

Hi @deathsurgeon1
Please, refer to example script

Firstly, you need to have saved the model in tflite format

nlu.save(save_path, save_tflite=True, conversion_mode="hybrid_quantization")

with conversion_mode can be one of the following modes:
normal
fp16_quantization
hybrid_quantization

Then, based on the conversion mode and your environment, you may need to disable GPU in the beginning of your script.

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"

Then, load the model with quantized=True and num_process=1 or any number of processes you want and then do prediction

nlu = TransformerNLU.load(model_path, quantized=True, num_process=1)

utterance = "add sabrina salerno to the grime instrumentals playlist"
result = nlu.predict(utterance)

I hope this will help you.
I'm planing to provide more examples and notebooks.
Documentation is in our plan.

Kindly, try to post your question in respective issues or open new issue.
Thanks.

@deathsurgeon1
Copy link

Thanks a lot for such detailed response :)

@MahmoudWahdan
Copy link
Owner Author

@deathsurgeon1 You are much welcomed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Request for new feature
Projects
None yet
Development

No branches or pull requests

2 participants