-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add encoding to two examples #577
base: main
Are you sure you want to change the base?
Conversation
Also fixed Examples/wordcloud_cn.py |
jieba.enable_parallel(4) | ||
# Setting up parallel processes :4 ,but unable to run on Windows | ||
import sys | ||
try: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do an if __name__ == "__main__"
that should fix that, I think?
Thanks for the PR! I restarted the CI that had some random issue, |
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 <[email protected]>
Sent: 01 August 2020 01:13
To: amueller/word_cloud <[email protected]>
Cc: Steve (Gadget) Barnes <[email protected]>; Author <[email protected]>
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>.
|
Yes, but it will only be true in the main process and so multiprocessing should work. |
Address #576