-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Word2Vec.load_word2vec_format should support python file like objects #372
Comments
Just use pickle manually then. The point of None of that is possible with just a file descriptor, so you might as well pickle the object manually. |
Ok. Maybe I'll look at what happens when I call open directly on an hdfs Thanks! On Tue, Jun 30, 2015 at 10:04 AM, Radim Řehůřek [email protected]
|
There was a comment somewhere that pickle might encounter problems on very-large numpy arrays. Is that true? If so, it'd be good to ensure there's a workaround for that other than the multi-path filesystem-persistence, since it's always nice to have the option to load/save from arbitrary streams/pipe/file-likes. |
Yes, that's one reason why gensim has a dedicated Some HDF5-like options for saving could be interesting too. Let me know if you write something in that direction, we could include that in gensim too (if it solves a common enough use-case with a sane enough API). |
Oops, I only just noticed this ticket is about @pgroth that's a much easier proposition -- can you submit a PR that will allow file-like param in By the way, allowing file handles in |
Sure. I'll probably do that next week or so. On Sun, Jul 5, 2015 at 10:06 PM, Radim Řehůřek [email protected]
|
What's the status of this? |
was this resolved? what version? |
No I don't think so. I never submitted a pull request
… On 10 Mar 2017, at 15:51, George Sanchez ***@***.***> wrote:
was this resolved? what version?
This is is what I get when I pass a file object to load
File "Lib\site-packages\gensim\models\word2vec.py", line 1470, in load
File "Lib\site-packages\gensim\utils.py", line 264, in load
File "Lib\site-packages\gensim\utils.py", line 329, in _adapt_by_suffix
AttributeError: 'file' object has no attribute 'endswith'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
hey, i also run into the same problem.. I'm loading a very big model (~1.6 Gb) from hdfs in gz format |
so i figured, the problem is that
|
@yupbank adding support for these two features ( |
Is anyone working on this as i can pick this up. The same issue persists with |
I didn’t get to it. |
Okay,i'd like to pick it up then, supporting file objects as an input along with filenames. |
@bhanu546 feel free to pick |
With 3.6 introducing the file-based training, this change would really be welcome. |
Currently, the loading code requires a filename. It would be nice to allow a file object to be given instead. This would make it easier to load models in environments (e.g. Spark) that don't necessarily have access to a normal file system.
The text was updated successfully, but these errors were encountered: