{"action":"created","comment":{"url":"https://api.github.com/repos/allenai/allennlp/pulls/comments/212130671","pull_request_review_id":148698272,"id":212130671,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjEzMDY3MQ==","diff_hunk":"@@ -496,7 +496,7 @@ def __init__(self,\n                  vocab_to_cache: List[str] = None) -> None:\n         super(_ElmoBiLm, self).__init__()\n \n-        self._token_embedder = _ElmoCharacterEncoder(options_file, weight_file, requires_grad=requires_grad)\n+        self._token_embedder = _ElmoCharacterEncoder(options_file, weight_file, requires_grad=False if vocab_to_cache is not None else requires_grad)","path":"allennlp/modules/elmo.py","position":null,"original_position":23,"commit_id":"cc3781dbc9f9ef56bc83b660543cdd342b7857e1","original_commit_id":"70ecfd582a56b321261527e155d5868dcc583917","user":{"login":"zfang","id":780646,"node_id":"MDQ6VXNlcjc4MDY0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/780646?v=4","gravatar_id":"","url":"https://api.github.com/users/zfang","html_url":"https://github.com/zfang","followers_url":"https://api.github.com/users/zfang/followers","following_url":"https://api.github.com/users/zfang/following{/other_user}","gists_url":"https://api.github.com/users/zfang/gists{/gist_id}","starred_url":"https://api.github.com/users/zfang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfang/subscriptions","organizations_url":"https://api.github.com/users/zfang/orgs","repos_url":"https://api.github.com/users/zfang/repos","events_url":"https://api.github.com/users/zfang/events{/privacy}","received_events_url":"https://api.github.com/users/zfang/received_events","type":"User","site_admin":false},"body":"@DeNeutoy Hmm maybe some people are using it like that by providing character embedding ids in addition to word embedding ids. In my case (which I thought is the more usual case if you use ELMo just as a drop-in solution to replace the existing layer `torch.nn.Embedding`) I'd only provide the word embedding ids.","created_at":"2018-08-22T22:29:12Z","updated_at":"2018-08-22T22:29:12Z","html_url":"https://github.com/allenai/allennlp/pull/1646#discussion_r212130671","pull_request_url":"https://api.github.com/repos/allenai/allennlp/pulls/1646","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/comments/212130671"},"html":{"href":"https://github.com/allenai/allennlp/pull/1646#discussion_r212130671"},"pull_request":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1646"}},"in_reply_to_id":212085856},"pull_request":{"url":"https://api.github.com/repos/allenai/allennlp/pulls/1646","id":210228447,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwMjI4NDQ3","html_url":"https://github.com/allenai/allennlp/pull/1646","diff_url":"https://github.com/allenai/allennlp/pull/1646.diff","patch_url":"https://github.com/allenai/allennlp/pull/1646.patch","issue_url":"https://api.github.com/repos/allenai/allennlp/issues/1646","number":1646,"state":"open","locked":false,"title":"Make _ElmoBiLM._token_embedder.requires_grad False when vocab_to_cache is provided","user":{"login":"zfang","id":780646,"node_id":"MDQ6VXNlcjc4MDY0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/780646?v=4","gravatar_id":"","url":"https://api.github.com/users/zfang","html_url":"https://github.com/zfang","followers_url":"https://api.github.com/users/zfang/followers","following_url":"https://api.github.com/users/zfang/following{/other_user}","gists_url":"https://api.github.com/users/zfang/gists{/gist_id}","starred_url":"https://api.github.com/users/zfang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfang/subscriptions","organizations_url":"https://api.github.com/users/zfang/orgs","repos_url":"https://api.github.com/users/zfang/repos","events_url":"https://api.github.com/users/zfang/events{/privacy}","received_events_url":"https://api.github.com/users/zfang/received_events","type":"User","site_admin":false},"body":"This PR is to address https://github.com/allenai/allennlp/issues/1644. When `vocab_to_cache` is provided, `_ElmoBiLM._token_embedder.requires_grad` should be `False` regardless if the `requires_grad` paramemter because \r\n\r\n1. It can cause `RuntimeError` (as per https://github.com/allenai/allennlp/issues/1644)\r\n2. ` _ElmoBiLM._word_embedding` is already created and cached when `vocab_to_cache` is provided, and therefore `_ElmoBiLM._token_embedder` will not be used later anyways.","created_at":"2018-08-22T18:46:17Z","updated_at":"2018-08-22T22:29:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1414505fadf514f4d27280bea6c067553cee39c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/allenai/allennlp/pulls/1646/commits","review_comments_url":"https://api.github.com/repos/allenai/allennlp/pulls/1646/comments","review_comment_url":"https://api.github.com/repos/allenai/allennlp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/allenai/allennlp/issues/1646/comments","statuses_url":"https://api.github.com/repos/allenai/allennlp/statuses/cc3781dbc9f9ef56bc83b660543cdd342b7857e1","head":{"label":"zfang:master","ref":"master","sha":"cc3781dbc9f9ef56bc83b660543cdd342b7857e1","user":{"login":"zfang","id":780646,"node_id":"MDQ6VXNlcjc4MDY0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/780646?v=4","gravatar_id":"","url":"https://api.github.com/users/zfang","html_url":"https://github.com/zfang","followers_url":"https://api.github.com/users/zfang/followers","following_url":"https://api.github.com/users/zfang/following{/other_user}","gists_url":"https://api.github.com/users/zfang/gists{/gist_id}","starred_url":"https://api.github.com/users/zfang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfang/subscriptions","organizations_url":"https://api.github.com/users/zfang/orgs","repos_url":"https://api.github.com/users/zfang/repos","events_url":"https://api.github.com/users/zfang/events{/privacy}","received_events_url":"https://api.github.com/users/zfang/received_events","type":"User","site_admin":false},"repo":{"id":145747821,"node_id":"MDEwOlJlcG9zaXRvcnkxNDU3NDc4MjE=","name":"allennlp","full_name":"zfang/allennlp","owner":{"login":"zfang","id":780646,"node_id":"MDQ6VXNlcjc4MDY0Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/780646?v=4","gravatar_id":"","url":"https://api.github.com/users/zfang","html_url":"https://github.com/zfang","followers_url":"https://api.github.com/users/zfang/followers","following_url":"https://api.github.com/users/zfang/following{/other_user}","gists_url":"https://api.github.com/users/zfang/gists{/gist_id}","starred_url":"https://api.github.com/users/zfang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zfang/subscriptions","organizations_url":"https://api.github.com/users/zfang/orgs","repos_url":"https://api.github.com/users/zfang/repos","events_url":"https://api.github.com/users/zfang/events{/privacy}","received_events_url":"https://api.github.com/users/zfang/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zfang/allennlp","description":"An open-source NLP research library, built on PyTorch.","fork":true,"url":"https://api.github.com/repos/zfang/allennlp","forks_url":"https://api.github.com/repos/zfang/allennlp/forks","keys_url":"https://api.github.com/repos/zfang/allennlp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zfang/allennlp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zfang/allennlp/teams","hooks_url":"https://api.github.com/repos/zfang/allennlp/hooks","issue_events_url":"https://api.github.com/repos/zfang/allennlp/issues/events{/number}","events_url":"https://api.github.com/repos/zfang/allennlp/events","assignees_url":"https://api.github.com/repos/zfang/allennlp/assignees{/user}","branches_url":"https://api.github.com/repos/zfang/allennlp/branches{/branch}","tags_url":"https://api.github.com/repos/zfang/allennlp/tags","blobs_url":"https://api.github.com/repos/zfang/allennlp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zfang/allennlp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zfang/allennlp/git/refs{/sha}","trees_url":"https://api.github.com/repos/zfang/allennlp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zfang/allennlp/statuses/{sha}","languages_url":"https://api.github.com/repos/zfang/allennlp/languages","stargazers_url":"https://api.github.com/repos/zfang/allennlp/stargazers","contributors_url":"https://api.github.com/repos/zfang/allennlp/contributors","subscribers_url":"https://api.github.com/repos/zfang/allennlp/subscribers","subscription_url":"https://api.github.com/repos/zfang/allennlp/subscription","commits_url":"https://api.github.com/repos/zfang/allennlp/commits{/sha}","git_commits_url":"https://api.github.com/repos/zfang/allennlp/git/commits{/sha}","comments_url":"https://api.github.com/repos/zfang/allennlp/comments{/number}","issue_comment_url":"https://api.github.com/repos/zfang/allennlp/issues/comments{/number}","contents_url":"https://api.github.com/repos/zfang/allennlp/contents/{+path}","compare_url":"https://api.github.com/repos/zfang/allennlp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zfang/allennlp/merges","archive_url":"https://api.github.com/repos/zfang/allennlp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zfang/allennlp/downloads","issues_url":"https://api.github.com/repos/zfang/allennlp/issues{/number}","pulls_url":"https://api.github.com/repos/zfang/allennlp/pulls{/number}","milestones_url":"https://api.github.com/repos/zfang/allennlp/milestones{/number}","notifications_url":"https://api.github.com/repos/zfang/allennlp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zfang/allennlp/labels{/name}","releases_url":"https://api.github.com/repos/zfang/allennlp/releases{/id}","deployments_url":"https://api.github.com/repos/zfang/allennlp/deployments","created_at":"2018-08-22T18:32:24Z","updated_at":"2018-08-22T20:56:28Z","pushed_at":"2018-08-22T20:56:27Z","git_url":"git://github.com/zfang/allennlp.git","ssh_url":"git@github.com:zfang/allennlp.git","clone_url":"https://github.com/zfang/allennlp.git","svn_url":"https://github.com/zfang/allennlp","homepage":"http://www.allennlp.org/","size":13686,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"allenai:master","ref":"master","sha":"bca6c2a17741468b0d202c7a986ed1e407f507d2","user":{"login":"allenai","id":5667695,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2Njc2OTU=","avatar_url":"https://avatars3.githubusercontent.com/u/5667695?v=4","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"repo":{"id":91356408,"node_id":"MDEwOlJlcG9zaXRvcnk5MTM1NjQwOA==","name":"allennlp","full_name":"allenai/allennlp","owner":{"login":"allenai","id":5667695,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU2Njc2OTU=","avatar_url":"https://avatars3.githubusercontent.com/u/5667695?v=4","gravatar_id":"","url":"https://api.github.com/users/allenai","html_url":"https://github.com/allenai","followers_url":"https://api.github.com/users/allenai/followers","following_url":"https://api.github.com/users/allenai/following{/other_user}","gists_url":"https://api.github.com/users/allenai/gists{/gist_id}","starred_url":"https://api.github.com/users/allenai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allenai/subscriptions","organizations_url":"https://api.github.com/users/allenai/orgs","repos_url":"https://api.github.com/users/allenai/repos","events_url":"https://api.github.com/users/allenai/events{/privacy}","received_events_url":"https://api.github.com/users/allenai/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/allenai/allennlp","description":"An open-source NLP research library, built on PyTorch.","fork":false,"url":"https://api.github.com/repos/allenai/allennlp","forks_url":"https://api.github.com/repos/allenai/allennlp/forks","keys_url":"https://api.github.com/repos/allenai/allennlp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/allenai/allennlp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/allenai/allennlp/teams","hooks_url":"https://api.github.com/repos/allenai/allennlp/hooks","issue_events_url":"https://api.github.com/repos/allenai/allennlp/issues/events{/number}","events_url":"https://api.github.com/repos/allenai/allennlp/events","assignees_url":"https://api.github.com/repos/allenai/allennlp/assignees{/user}","branches_url":"https://api.github.com/repos/allenai/allennlp/branches{/branch}","tags_url":"https://api.github.com/repos/allenai/allennlp/tags","blobs_url":"https://api.github.com/repos/allenai/allennlp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/allenai/allennlp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/allenai/allennlp/git/refs{/sha}","trees_url":"https://api.github.com/repos/allenai/allennlp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/allenai/allennlp/statuses/{sha}","languages_url":"https://api.github.com/repos/allenai/allennlp/languages","stargazers_url":"https://api.github.com/repos/allenai/allennlp/stargazers","contributors_url":"https://api.github.com/repos/allenai/allennlp/contributors","subscribers_url":"https://api.github.com/repos/allenai/allennlp/subscribers","subscription_url":"https://api.github.com/repos/allenai/allennlp/subscription","commits_url":"https://api.github.com/repos/allenai/allennlp/commits{/sha}","git_commits_url":"https://api.github.com/repos/allenai/allennlp/git/commits{/sha}","comments_url":"https://api.github.com/repos/allenai/allennlp/comments{/number}","issue_comment_url":"https://api.github.com/repos/allenai/allennlp/issues/comments{/number}","contents_url":"https://api.github.com/repos/allenai/allennlp/contents/{+path}","compare_url":"https://api.github.com/repos/allenai/allennlp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/allenai/allennlp/merges","archive_url":"https://api.github.com/repos/allenai/allennlp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/allenai/allennlp/downloads","issues_url":"https://api.github.com/repos/allenai/allennlp/issues{/number}","pulls_url":"https://api.github.com/repos/allenai/allennlp/pulls{/number}","milestones_url":"https://api.github.com/repos/allenai/allennlp/milestones{/number}","notifications_url":"https://api.github.com/repos/allenai/allennlp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/allenai/allennlp/labels{/name}","releases_url":"https://api.github.com/repos/allenai/allennlp/releases{/id}","deployments_url":"https://api.github.com/repos/allenai/allennlp/deployments","created_at":"2017-05-15T15:52:41Z","updated_at":"2018-08-22T20:48:21Z","pushed_at":"2018-08-22T22:15:50Z","git_url":"git://github.com/allenai/allennlp.git","ssh_url":"git@github.com:allenai/allennlp.git","clone_url":"https://github.com/allenai/allennlp.git","svn_url":"https://github.com/allenai/allennlp","homepage":"http://www.allennlp.org/","size":13668,"stargazers_count":2994,"watchers_count":2994,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":512,"mirror_url":null,"archived":false,"open_issues_count":102,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":512,"open_issues":102,"watchers":2994,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1646"},"html":{"href":"https://github.com/allenai/allennlp/pull/1646"},"issue":{"href":"https://api.github.com/repos/allenai/allennlp/issues/1646"},"comments":{"href":"https://api.github.com/repos/allenai/allennlp/issues/1646/comments"},"review_comments":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1646/comments"},"review_comment":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/allenai/allennlp/pulls/1646/commits"},"statuses":{"href":"https://api.github.com/repos/allenai/allennlp/statuses/cc3781dbc9f9ef56bc83b660543cdd342b7857e1"}},"author_association":"NONE"}}
{"actor":{"display_login":"zfang"}}