Open
Conversation
Author
|
Also fixed Examples/wordcloud_cn.py |
amueller
reviewed
Aug 1, 2020
| jieba.enable_parallel(4) | ||
| # Setting up parallel processes :4 ,but unable to run on Windows | ||
| import sys | ||
| try: |
Owner
There was a problem hiding this comment.
you can do an if __name__ == "__main__" that should fix that, I think?
Owner
|
Thanks for the PR! I restarted the CI that had some random issue, |
Author
|
No – the trick is not to try to run parallel on Windows (at the moment) if __name__ == “__main__” will be as true on Windows as on any other platform.
From: Andreas Mueller <notifications@github.com>
Sent: 01 August 2020 01:13
To: amueller/word_cloud <word_cloud@noreply.github.com>
Cc: Steve (Gadget) Barnes <gadgetsteve@hotmail.com>; Author <author@noreply.github.com>
Subject: Re: [amueller/word_cloud] Add encoding to two examples (#577)
@amueller commented on this pull request.
________________________________
In examples/wordcloud_cn.py<#577 (comment)>:
@@ -12,9 +12,14 @@
at the same time using wordcloud with jieba very convenient
"""
…-import jieba
-jieba.enable_parallel(4)
-# Setting up parallel processes :4 ,but unable to run on Windows
+import sys
+try:
you can do an if __name__ == "__main__" that should fix that, I think?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#577 (review)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABKVUWUR64UZY2AQWBBHP4LR6NM2JANCNFSM4PNEJQIA>.
|
Owner
|
Yes, but it will only be true in the main process and so multiprocessing should work. |
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Address #576