-
Notifications
You must be signed in to change notification settings - Fork 147
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
Loading pretrained models #38
Comments
Hello @VikaNa! you just need to initialize a model first with the correct input size and then you can call the loss function. ct = ZeroShotTM(input_size=2000, bert_input_size=512)
ct.load("path_to_folder", epoch=13) One thing: this is mostly an experimental feature that we haven't been testing. I did some experiments and it seems to work (see the screenshot, I trained a ctm model, saved it, and then reloaded it and checked if the topics produced were the same): I plan to work on adding some tests to this feature in the future. To save the model you can also use the standard pickle package in python: https://thepythonguru.com/pickling-objects-in-python/ Let me know if everything works or if you encounter other issues :)! |
Hello @vinid , thank you for your quick respond!
or
Could you help me with this issue? |
Hello! those two functionalities have been introduced in contextualized topic models 1.7.1. You can run
to get the latest stable version. Beware as I told you the saving/loading methods are still experimental. Thus, I am not sure - if you can check and get back to me it would be great - if you can reload the model you have trained with version 1.7.0. You might have to retrain the model with 1.7.1 to be able to load it. Thanks :) |
After patching one issue in the code (because I don't have a cuda on my local PC) it worked fine! ctm.py line 418 |
thanks a lot! I'll reopen this so I know I have to fix it |
Refer to #106 |
Description
I have trained a Zero Shot Cross Lingual topic model and saved it with the .save() method. Now, I have problems with loading this model.
What I Did
This resulted in the following error:
Could you please tell me, what would be the right way to load a pretrained Zero Shot model ?
Thank you!
The text was updated successfully, but these errors were encountered: