{"action":"created","comment":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments/116891498","pull_request_review_id":38550200,"id":116891498,"diff_hunk":"@@ -1054,13 +1059,22 @@ def load(cls, fname, *args, **kwargs):\n             result.state = super(LdaModel, cls).load(state_fname, *args, **kwargs)\n         except Exception as e:\n             logging.warning(\"failed to load state from %s: %s\", state_fname, e)\n-        id2word_fname = utils.smart_extension(fname, '.id2word')\n-        if (os.path.isfile(id2word_fname)):\n-            try:\n-                result.id2word = utils.unpickle(id2word_fname)\n-            except Exception as e:\n-                logging.warning(\"failed to load id2word dictionary from %s: %s\", id2word_fname, e)\n+\n+        random_state_fname = utils.smart_extension(fname, '.random_state')\n+        if (os.path.isfile(random_state_fname)):\n+            result.random_state = utils.unpickle(random_state_fname)\n         else:\n-            result.id2word = None\n+            logging.warning(\"random_state not stored on disk so using default value\")","path":"gensim/models/ldamodel.py","position":40,"original_position":40,"commit_id":"81d3b3fab884a0dc993e14f3a1c6dda4162cb925","original_commit_id":"81d3b3fab884a0dc993e14f3a1c6dda4162cb925","user":{"login":"chinmayapancholi13","id":10104911,"avatar_url":"https://avatars2.githubusercontent.com/u/10104911?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmayapancholi13","html_url":"https://github.com/chinmayapancholi13","followers_url":"https://api.github.com/users/chinmayapancholi13/followers","following_url":"https://api.github.com/users/chinmayapancholi13/following{/other_user}","gists_url":"https://api.github.com/users/chinmayapancholi13/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmayapancholi13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmayapancholi13/subscriptions","organizations_url":"https://api.github.com/users/chinmayapancholi13/orgs","repos_url":"https://api.github.com/users/chinmayapancholi13/repos","events_url":"https://api.github.com/users/chinmayapancholi13/events{/privacy}","received_events_url":"https://api.github.com/users/chinmayapancholi13/received_events","type":"User","site_admin":false},"body":"@tmylk Your suggestion is a bit different from the [earlier discussion](https://github.com/RaRe-Technologies/gensim/issues/1082#issuecomment-301164932) on the issue. Hence, I want to make sure I understand the desired solution before making the changes.\r\n\r\nIf I understand it correctly, what you are suggesting is :  \r\n- If there is indeed a file with the extension `.random_state` present on disk, this means that the model was saved using a pre-0.13.2 version of Gensim. So we use this file to set `result.random_state` at the time of loading. \r\n- However, if there is no such file present on disk, then this means that the model was saved using a post-0.13.2 version of Gensim and thus `result.random_state` got set at the time of the main pickle load. So in this case, we don't need to do anything else.\r\n\r\nBut for models saved using a pre-0.13.2 version of Gensim, there was no `.random_state` file created at the time of saving the model. So while loading such a model from disk, where would the `.random_state` file come from in this case? Is the user responsible for creating this file explicitly in such a case? If this is true, then I believe we don't need to make any changes in the `save` function for LdaModel at all and we just need to change the `load` function. \r\n\r\nPlease correct me if I am wrong or missing something here. Otherwise, if this is indeed what we need, I could go ahead and make the appropriate changes.","created_at":"2017-05-17T01:07:52Z","updated_at":"2017-05-17T01:07:52Z","html_url":"https://github.com/RaRe-Technologies/gensim/pull/1327#discussion_r116891498","pull_request_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327","_links":{"self":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments/116891498"},"html":{"href":"https://github.com/RaRe-Technologies/gensim/pull/1327#discussion_r116891498"},"pull_request":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327"}}},"pull_request":{"url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327","id":120725857,"html_url":"https://github.com/RaRe-Technologies/gensim/pull/1327","diff_url":"https://github.com/RaRe-Technologies/gensim/pull/1327.diff","patch_url":"https://github.com/RaRe-Technologies/gensim/pull/1327.patch","issue_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1327","number":1327,"state":"open","locked":false,"title":"[WIP] Fix backward incompatibility due to `random_state`","user":{"login":"chinmayapancholi13","id":10104911,"avatar_url":"https://avatars2.githubusercontent.com/u/10104911?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmayapancholi13","html_url":"https://github.com/chinmayapancholi13","followers_url":"https://api.github.com/users/chinmayapancholi13/followers","following_url":"https://api.github.com/users/chinmayapancholi13/following{/other_user}","gists_url":"https://api.github.com/users/chinmayapancholi13/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmayapancholi13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmayapancholi13/subscriptions","organizations_url":"https://api.github.com/users/chinmayapancholi13/orgs","repos_url":"https://api.github.com/users/chinmayapancholi13/repos","events_url":"https://api.github.com/users/chinmayapancholi13/events{/privacy}","received_events_url":"https://api.github.com/users/chinmayapancholi13/received_events","type":"User","site_admin":false},"body":"This PR fixes issue https://github.com/RaRe-Technologies/gensim/issues/1082.","created_at":"2017-05-16T01:07:50Z","updated_at":"2017-05-17T01:07:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"944ea820f40e9d85816cb7483f35c269c4558b4a","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327/commits","review_comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327/comments","review_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1327/comments","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/81d3b3fab884a0dc993e14f3a1c6dda4162cb925","head":{"label":"chinmayapancholi13:random_state_pr4","ref":"random_state_pr4","sha":"81d3b3fab884a0dc993e14f3a1c6dda4162cb925","user":{"login":"chinmayapancholi13","id":10104911,"avatar_url":"https://avatars2.githubusercontent.com/u/10104911?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmayapancholi13","html_url":"https://github.com/chinmayapancholi13","followers_url":"https://api.github.com/users/chinmayapancholi13/followers","following_url":"https://api.github.com/users/chinmayapancholi13/following{/other_user}","gists_url":"https://api.github.com/users/chinmayapancholi13/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmayapancholi13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmayapancholi13/subscriptions","organizations_url":"https://api.github.com/users/chinmayapancholi13/orgs","repos_url":"https://api.github.com/users/chinmayapancholi13/repos","events_url":"https://api.github.com/users/chinmayapancholi13/events{/privacy}","received_events_url":"https://api.github.com/users/chinmayapancholi13/received_events","type":"User","site_admin":false},"repo":{"id":83887199,"name":"gensim","full_name":"chinmayapancholi13/gensim","owner":{"login":"chinmayapancholi13","id":10104911,"avatar_url":"https://avatars2.githubusercontent.com/u/10104911?v=3","gravatar_id":"","url":"https://api.github.com/users/chinmayapancholi13","html_url":"https://github.com/chinmayapancholi13","followers_url":"https://api.github.com/users/chinmayapancholi13/followers","following_url":"https://api.github.com/users/chinmayapancholi13/following{/other_user}","gists_url":"https://api.github.com/users/chinmayapancholi13/gists{/gist_id}","starred_url":"https://api.github.com/users/chinmayapancholi13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chinmayapancholi13/subscriptions","organizations_url":"https://api.github.com/users/chinmayapancholi13/orgs","repos_url":"https://api.github.com/users/chinmayapancholi13/repos","events_url":"https://api.github.com/users/chinmayapancholi13/events{/privacy}","received_events_url":"https://api.github.com/users/chinmayapancholi13/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chinmayapancholi13/gensim","description":"Topic Modelling for Humans","fork":true,"url":"https://api.github.com/repos/chinmayapancholi13/gensim","forks_url":"https://api.github.com/repos/chinmayapancholi13/gensim/forks","keys_url":"https://api.github.com/repos/chinmayapancholi13/gensim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chinmayapancholi13/gensim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chinmayapancholi13/gensim/teams","hooks_url":"https://api.github.com/repos/chinmayapancholi13/gensim/hooks","issue_events_url":"https://api.github.com/repos/chinmayapancholi13/gensim/issues/events{/number}","events_url":"https://api.github.com/repos/chinmayapancholi13/gensim/events","assignees_url":"https://api.github.com/repos/chinmayapancholi13/gensim/assignees{/user}","branches_url":"https://api.github.com/repos/chinmayapancholi13/gensim/branches{/branch}","tags_url":"https://api.github.com/repos/chinmayapancholi13/gensim/tags","blobs_url":"https://api.github.com/repos/chinmayapancholi13/gensim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chinmayapancholi13/gensim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chinmayapancholi13/gensim/git/refs{/sha}","trees_url":"https://api.github.com/repos/chinmayapancholi13/gensim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chinmayapancholi13/gensim/statuses/{sha}","languages_url":"https://api.github.com/repos/chinmayapancholi13/gensim/languages","stargazers_url":"https://api.github.com/repos/chinmayapancholi13/gensim/stargazers","contributors_url":"https://api.github.com/repos/chinmayapancholi13/gensim/contributors","subscribers_url":"https://api.github.com/repos/chinmayapancholi13/gensim/subscribers","subscription_url":"https://api.github.com/repos/chinmayapancholi13/gensim/subscription","commits_url":"https://api.github.com/repos/chinmayapancholi13/gensim/commits{/sha}","git_commits_url":"https://api.github.com/repos/chinmayapancholi13/gensim/git/commits{/sha}","comments_url":"https://api.github.com/repos/chinmayapancholi13/gensim/comments{/number}","issue_comment_url":"https://api.github.com/repos/chinmayapancholi13/gensim/issues/comments{/number}","contents_url":"https://api.github.com/repos/chinmayapancholi13/gensim/contents/{+path}","compare_url":"https://api.github.com/repos/chinmayapancholi13/gensim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chinmayapancholi13/gensim/merges","archive_url":"https://api.github.com/repos/chinmayapancholi13/gensim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chinmayapancholi13/gensim/downloads","issues_url":"https://api.github.com/repos/chinmayapancholi13/gensim/issues{/number}","pulls_url":"https://api.github.com/repos/chinmayapancholi13/gensim/pulls{/number}","milestones_url":"https://api.github.com/repos/chinmayapancholi13/gensim/milestones{/number}","notifications_url":"https://api.github.com/repos/chinmayapancholi13/gensim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chinmayapancholi13/gensim/labels{/name}","releases_url":"https://api.github.com/repos/chinmayapancholi13/gensim/releases{/id}","deployments_url":"https://api.github.com/repos/chinmayapancholi13/gensim/deployments","created_at":"2017-03-04T11:01:45Z","updated_at":"2017-03-04T11:01:48Z","pushed_at":"2017-05-16T18:38:44Z","git_url":"git://github.com/chinmayapancholi13/gensim.git","ssh_url":"git@github.com:chinmayapancholi13/gensim.git","clone_url":"https://github.com/chinmayapancholi13/gensim.git","svn_url":"https://github.com/chinmayapancholi13/gensim","homepage":"http://radimrehurek.com/gensim/","size":33359,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"RaRe-Technologies:develop","ref":"develop","sha":"29968840f350746647f0b0e7c880d9d3866c5522","user":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars0.githubusercontent.com/u/12515886?v=3","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"repo":{"id":1349775,"name":"gensim","full_name":"RaRe-Technologies/gensim","owner":{"login":"RaRe-Technologies","id":12515886,"avatar_url":"https://avatars0.githubusercontent.com/u/12515886?v=3","gravatar_id":"","url":"https://api.github.com/users/RaRe-Technologies","html_url":"https://github.com/RaRe-Technologies","followers_url":"https://api.github.com/users/RaRe-Technologies/followers","following_url":"https://api.github.com/users/RaRe-Technologies/following{/other_user}","gists_url":"https://api.github.com/users/RaRe-Technologies/gists{/gist_id}","starred_url":"https://api.github.com/users/RaRe-Technologies/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RaRe-Technologies/subscriptions","organizations_url":"https://api.github.com/users/RaRe-Technologies/orgs","repos_url":"https://api.github.com/users/RaRe-Technologies/repos","events_url":"https://api.github.com/users/RaRe-Technologies/events{/privacy}","received_events_url":"https://api.github.com/users/RaRe-Technologies/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RaRe-Technologies/gensim","description":"Topic Modelling for Humans","fork":false,"url":"https://api.github.com/repos/RaRe-Technologies/gensim","forks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/forks","keys_url":"https://api.github.com/repos/RaRe-Technologies/gensim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RaRe-Technologies/gensim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RaRe-Technologies/gensim/teams","hooks_url":"https://api.github.com/repos/RaRe-Technologies/gensim/hooks","issue_events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/events{/number}","events_url":"https://api.github.com/repos/RaRe-Technologies/gensim/events","assignees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/assignees{/user}","branches_url":"https://api.github.com/repos/RaRe-Technologies/gensim/branches{/branch}","tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/tags","blobs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/refs{/sha}","trees_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/{sha}","languages_url":"https://api.github.com/repos/RaRe-Technologies/gensim/languages","stargazers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/stargazers","contributors_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contributors","subscribers_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscribers","subscription_url":"https://api.github.com/repos/RaRe-Technologies/gensim/subscription","commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/commits{/sha}","git_commits_url":"https://api.github.com/repos/RaRe-Technologies/gensim/git/commits{/sha}","comments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/comments{/number}","issue_comment_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/comments{/number}","contents_url":"https://api.github.com/repos/RaRe-Technologies/gensim/contents/{+path}","compare_url":"https://api.github.com/repos/RaRe-Technologies/gensim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RaRe-Technologies/gensim/merges","archive_url":"https://api.github.com/repos/RaRe-Technologies/gensim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RaRe-Technologies/gensim/downloads","issues_url":"https://api.github.com/repos/RaRe-Technologies/gensim/issues{/number}","pulls_url":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls{/number}","milestones_url":"https://api.github.com/repos/RaRe-Technologies/gensim/milestones{/number}","notifications_url":"https://api.github.com/repos/RaRe-Technologies/gensim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RaRe-Technologies/gensim/labels{/name}","releases_url":"https://api.github.com/repos/RaRe-Technologies/gensim/releases{/id}","deployments_url":"https://api.github.com/repos/RaRe-Technologies/gensim/deployments","created_at":"2011-02-10T07:43:04Z","updated_at":"2017-05-16T21:06:49Z","pushed_at":"2017-05-17T00:36:22Z","git_url":"git://github.com/RaRe-Technologies/gensim.git","ssh_url":"git@github.com:RaRe-Technologies/gensim.git","clone_url":"https://github.com/RaRe-Technologies/gensim.git","svn_url":"https://github.com/RaRe-Technologies/gensim","homepage":"http://radimrehurek.com/gensim/","size":33263,"stargazers_count":4310,"watchers_count":4310,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1670,"mirror_url":null,"open_issues_count":181,"forks":1670,"open_issues":181,"watchers":4310,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327"},"html":{"href":"https://github.com/RaRe-Technologies/gensim/pull/1327"},"issue":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1327"},"comments":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/issues/1327/comments"},"review_comments":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327/comments"},"review_comment":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/pulls/1327/commits"},"statuses":{"href":"https://api.github.com/repos/RaRe-Technologies/gensim/statuses/81d3b3fab884a0dc993e14f3a1c6dda4162cb925"}}}}
{"actor":{"display_login":"chinmayapancholi13"}}