pluiez / NLLB-inference

56 stars 6 forks source link

simple question about nllb-inference #4

Closed daje0601 closed 2 years ago

daje0601 commented 2 years ago

Hello, I saw your youtube and github code. So Thank you!

Thanks to this, I was able to run it in Colab. When I ran it, I was able to observe that it showed really good performance.

I want to customize this bash code to python. bash is so hard.. Can you tell me how to fix this code in python? If that's difficult, can you explain how this code works?

please merry on me

pluiez commented 2 years ago

Hi,the video is posted by @amrrs.

The script starts from translate.sh and run preprocess/normalize_punctuation.sh to normalize punctuation according to given langauge, then run spm_encode to encode the normalized text to sentence pieces. Finally, it runs fairseq's built-in command fairseq-interactve to receive inputs from standard input to generate translations.

By the way, Bash script is a nice tool to chain multiple programs as a pipeline, you might want to learn it if not yet.

daje0601 commented 2 years ago

First of all, I really thank you for your response. I agree that Bash script is great. I will learn bash script later.

What I'm thinking about it that bash script always reload the model I want to just language translation. I don't catch how can I fix it? I'm still thinking..

pluiez commented 2 years ago

First of all, I really thank you for your response. I agree that Bash script is great. I will learn bash script later.

�What I'm thinking about it that bash script always reload the model I want to just language translation. I don't catch how can I fix it? I'm still thinking..

Do you mean you want to load a model and then change the langauges later for translation?

daje0601 commented 2 years ago

First of all, I really thank you for your response. I agree that Bash script is great. I will learn bash script later. What I'm thinking about it that bash script always reload the model I want to just language translation. I don't catch how can I fix it? I'm still thinking..

Do you mean you want to load a model and then change the langauges later for translation?

Yes! Exactly!

daje0601 commented 2 years ago

Actually, I am a junior who has only been learning Python for a year. However, we are growing by challenging myself as much as possible.

pluiez commented 2 years ago

First of all, I really thank you for your response. I agree that Bash script is great. I will learn bash script later. What I'm thinking about it that bash script always reload the model I want to just language translation. I don't catch how can I fix it? I'm still thinking..

Do you mean you want to load a model and then change the langauges later for translation?

Yes! Exactly!

You can check this https://stackoverflow.com/questions/66525973/running-fairseq-in-memory-and-pre-load-language-models

daje0601 commented 2 years ago

Thank you!