Skip to content
This repository has been archived by the owner on Mar 19, 2024. It is now read-only.

Useless warning message on load_model #1067

Closed
osma opened this issue May 13, 2020 · 4 comments
Closed

Useless warning message on load_model #1067

osma opened this issue May 13, 2020 · 4 comments

Comments

@osma
Copy link

osma commented May 13, 2020

In the Python bindings of version 0.9.2, every time I call load_model - which in my understanding is the correct way to load saved models - fastText prints this message on stderr:

Warning : load_model does not return WordVectorModel or SupervisedModel any more, but a FastText object which is very similar.

It's defined on this line

I understand that sometimes it's useful to explain API changes to users, especially when deprecated features are being accessed and better ways exist. But this seems a bit excessive, since there is no other way of loading the model so no easy way to avoid the message.

I silenced the warning by monkeypatching eprint like this:

fasttext.FastText.eprint = lambda x: None

This is related to #909 which reported a problem (since fixed) that the warning message was printed as a blank line.

@Celebio
Copy link
Member

Celebio commented Jun 2, 2020

Hi @osma ,
Thank you very much for your feedback.

This message was added to facilitate the transition between our old python module to the new one, as described here.

The message was removed by the commit 9ef22d9.

I will close the issue now. Thank you again for feedback.

Onur

@saippuakauppias
Copy link

@Celebio can you publish new version on pypi? My package denend from fasttext, but I can't publish him:

Invalid value for requires_dist. Error: Can't have direct dependency: 'fasttext @ https://github.com/facebookresearch/fastText/archive/a20c0d27cd0ee88a25ea0433b7f03038cd728459.zip#egg=fasttext-0.9.2'

@noelslice
Copy link

@Celebio it would be much appreciated to have a new release with this warning removed

@saippuakauppias
Copy link

@noelslice please write the same in: #1135

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

No branches or pull requests

4 participants