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

How can i use a fine tuned model in a python project #94

Closed
padel1 opened this issue Mar 16, 2024 · 3 comments
Closed

How can i use a fine tuned model in a python project #94

padel1 opened this issue Mar 16, 2024 · 3 comments

Comments

@padel1
Copy link

padel1 commented Mar 16, 2024

I fine-tuned a model from Arabic to English and achieved good results, unlike the other methods I've tried. Now, I aim to incorporate this resulting model into a Python code. I attempted to convert it using convert_marian_to_pytorch.py, but the resulting model only produces random false outputs.

@mrpi007
Copy link

mrpi007 commented Mar 17, 2024

I just recently managed to do just that with a fine-tuned English to German model using Ctranslate2 (https://pypi.org/project/ctranslate2/ and https://opennmt.net/CTranslate2/index.html). The conversion of the model was super fast (seconds) and the converted model behaves exactly the same. I haven't done much coding yet to put this to use. So I can't comment on still possible issues at that end.

@padel1
Copy link
Author

padel1 commented Mar 19, 2024

I just recently managed to do just that with a fine-tuned English to German model using Ctranslate2 (https://pypi.org/project/ctranslate2/ and https://opennmt.net/CTranslate2/index.html). The conversion of the model was super fast (seconds) and the converted model behaves exactly the same. I haven't done much coding yet to put this to use. So I can't comment on still possible issues at that end.

thanks for the reply but could you please give me the steps to convert and use or the code

@mrpi007
Copy link

mrpi007 commented Mar 19, 2024

https://opennmt.net/CTranslate2/quickstart.html : step 1 to 4, section Python
https://opennmt.net/CTranslate2/guides/opus_mt.html : code example on how to use the converted model

Hope that helps.

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

No branches or pull requests

3 participants