payload: {"action":"created","issue":{"url":"https://api.github.com/repos/huggingface/transformers/issues/1636","repository_url":"https://api.github.com/repos/huggingface/transformers","labels_url":"https://api.github.com/repos/huggingface/transformers/issues/1636/labels{/name}","comments_url":"https://api.github.com/repos/huggingface/transformers/issues/1636/comments","events_url":"https://api.github.com/repos/huggingface/transformers/issues/1636/events","html_url":"https://github.com/huggingface/transformers/issues/1636","id":512739758,"node_id":"MDU6SXNzdWU1MTI3Mzk3NTg=","number":1636,"title":"AttributeError: 'CTRLTokenizer' object has no attribute 'control_codes'","user":{"login":"vessenes","id":1199717,"node_id":"MDQ6VXNlcjExOTk3MTc=","avatar_url":"https://avatars2.githubusercontent.com/u/1199717?v=4","gravatar_id":"","url":"https://api.github.com/users/vessenes","html_url":"https://github.com/vessenes","followers_url":"https://api.github.com/users/vessenes/followers","following_url":"https://api.github.com/users/vessenes/following{/other_user}","gists_url":"https://api.github.com/users/vessenes/gists{/gist_id}","starred_url":"https://api.github.com/users/vessenes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vessenes/subscriptions","organizations_url":"https://api.github.com/users/vessenes/orgs","repos_url":"https://api.github.com/users/vessenes/repos","events_url":"https://api.github.com/users/vessenes/events{/privacy}","received_events_url":"https://api.github.com/users/vessenes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2019-10-25T22:08:36Z","updated_at":"2019-11-07T09:39:01Z","closed_at":"2019-10-31T19:04:06Z","author_association":"NONE","body":"## 🐛 Bug\r\n\r\nI can't seem to get ctrl generation working. \r\n\r\nThis is with a pull of the repo from master, and pip3 install as recommended during installation:\r\n\r\nThe problem arise when using:\r\n* [ X ] the official example scripts: \r\n\r\n```bash\r\n$ uname -a\r\nLinux ctrl 4.9.0-11-amd64 #1 SMP Debian 4.9.189-3+deb9u1 (2019-09-20) x86_64 GNU/Linux\r\n```\r\n\r\n\r\n<!-- If you have a code sample, error messages, stack traces, please provide it here as well. -->\r\n```bash\r\npython3 ./examples/run_generation.py     --model_type=ctrl     --length=20     --model_name_or_path=ctrl     --temperature=0     --repetition_penalty=1.2 \r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:516: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:517: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:518: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:519: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:520: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorflow/python/framework/dtypes.py:525: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:541: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_qint8 = np.dtype([(\"qint8\", np.int8, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:542: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_quint8 = np.dtype([(\"quint8\", np.uint8, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:543: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_qint16 = np.dtype([(\"qint16\", np.int16, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:544: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_quint16 = np.dtype([(\"quint16\", np.uint16, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:545: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  _np_qint32 = np.dtype([(\"qint32\", np.int32, 1)])\r\n/home/vessenes/.local/lib/python3.5/site-packages/tensorboard/compat/tensorflow_stub/dtypes.py:550: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'.\r\n  np_resource = np.dtype([(\"resource\", np.ubyte, 1)])\r\n10/25/2019 22:11:28 - INFO - transformers.tokenization_utils -   loading file https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-vocab.json from cache at /home/vessenes/.cache/torch/transformers/a858ad854d3847b02da3aac63555142de6a05f2a26d928bb49e881970514e186.285c96a541cf6719677cfb634929022b56b76a0c9a540186ba3d8bbdf02bca42\r\n10/25/2019 22:11:28 - INFO - transformers.tokenization_utils -   loading file https://raw.githubusercontent.com/salesforce/ctrl/master/ctrl-merges.txt from cache at /home/vessenes/.cache/torch/transformers/aa2c569e6648690484ade28535a8157aa415f15202e84a62e82cc36ea0c20fa9.26153bf569b71aaf15ae54be4c1b9254dbeff58ca6fc3e29468c4eed078ac142\r\n10/25/2019 22:11:29 - INFO - transformers.configuration_utils -   loading configuration file https://storage.googleapis.com/sf-ctrl/pytorch/ctrl-config.json from cache at /home/vessenes/.cache/torch/transformers/d6492ca334c2a4e079f43df30956acf935134081b2b3844dc97457be69b623d0.1ebc47eb44e70492e0c20494a084f108332d20fea7fe5ad408ef5e7a8f2baef4\r\n10/25/2019 22:11:29 - INFO - transformers.configuration_utils -   Model config {\r\n  \"attn_pdrop\": 0.1,\r\n  \"dff\": 8192,\r\n  \"embd_pdrop\": 0.1,\r\n  \"finetuning_task\": null,\r\n  \"from_tf\": false,\r\n  \"initializer_range\": 0.02,\r\n  \"layer_norm_epsilon\": 1e-06,\r\n  \"n_ctx\": 512,\r\n  \"n_embd\": 1280,\r\n  \"n_head\": 16,\r\n  \"n_layer\": 48,\r\n  \"n_positions\": 50000,\r\n  \"num_labels\": 1,\r\n  \"output_attentions\": false,\r\n  \"output_hidden_states\": false,\r\n  \"output_past\": true,\r\n  \"pruned_heads\": {},\r\n  \"resid_pdrop\": 0.1,\r\n  \"summary_activation\": null,\r\n  \"summary_first_dropout\": 0.1,\r\n  \"summary_proj_to_labels\": true,\r\n  \"summary_type\": \"cls_index\",\r\n  \"summary_use_proj\": true,\r\n  \"torchscript\": false,\r\n  \"use_bfloat16\": false,\r\n  \"vocab_size\": 246534\r\n}\r\n10/25/2019 22:00:19 - INFO - transformers.modeling_utils -   loading weights file https://storage.googleapis.com/sf\r\n-ctrl/pytorch/seqlen256_v1.bin from cache at /home/vessenes/.cache/torch/transformers/c146cc96724f27295a0c3ada1fbb3\r\n632074adf87e9aef8269e44c9208787f8c8.b986347cbab65fa276683efbb9c2f7ee22552277bcf6e1f1166557ed0852fdf0\r\n10/25/2019 22:01:17 - INFO - __main__ -   Namespace(device=device(type='cpu'), length=20, model_name_or_path='ctrl'\r\n, model_type='ctrl', n_gpu=0, no_cuda=False, padding_text='', prompt='', repetition_penalty=1.2, seed=42, stop_toke\r\nn=None, temperature=0.0, top_k=0, top_p=0.9, xlm_lang='')\r\nModel prompt >>> Link Thid is a test article\r\nTraceback (most recent call last):\r\n  File \"./examples/run_generation.py\", line 256, in <module>\r\n    main()\r\n  File \"./examples/run_generation.py\", line 228, in main\r\n    if not any(context_tokens[0] == x for x in tokenizer.control_codes.values()):\r\nAttributeError: 'CTRLTokenizer' object has no attribute 'control_codes'\r\n```\r\n\r\n## Expected behavior\r\n\r\nI expect to be able to type in a prompt and see text generated.\r\n\r\n\r\n## Environment\r\n\r\n* OS: Debian 4.9\r\n* Python version: 3.5.3\r\n* PyTorch version: 1.3.0 \r\n* PyTorch Transformers version (or branch): not sure how to find this info\r\n* Using GPU ?  Yes - V100 on GCP\r\n* Distributed of parallel setup ? No\r\n* Any other relevant information:\r\n\r\n## Additional context\r\n\r\n<!-- Add any other context about the problem here. -->\r\n"},"comment":{"url":"https://api.github.com/repos/huggingface/transformers/issues/comments/551001022","html_url":"https://github.com/huggingface/transformers/issues/1636#issuecomment-551001022","issue_url":"https://api.github.com/repos/huggingface/transformers/issues/1636","id":551001022,"node_id":"MDEyOklzc3VlQ29tbWVudDU1MTAwMTAyMg==","user":{"login":"mzjuin","id":17661426,"node_id":"MDQ6VXNlcjE3NjYxNDI2","avatar_url":"https://avatars3.githubusercontent.com/u/17661426?v=4","gravatar_id":"","url":"https://api.github.com/users/mzjuin","html_url":"https://github.com/mzjuin","followers_url":"https://api.github.com/users/mzjuin/followers","following_url":"https://api.github.com/users/mzjuin/following{/other_user}","gists_url":"https://api.github.com/users/mzjuin/gists{/gist_id}","starred_url":"https://api.github.com/users/mzjuin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzjuin/subscriptions","organizations_url":"https://api.github.com/users/mzjuin/orgs","repos_url":"https://api.github.com/users/mzjuin/repos","events_url":"https://api.github.com/users/mzjuin/events{/privacy}","received_events_url":"https://api.github.com/users/mzjuin/received_events","type":"User","site_admin":false},"created_at":"2019-11-07T09:39:01Z","updated_at":"2019-11-07T09:39:01Z","author_association":"NONE","body":"> As suggested correctly by @julien-c, in order to solve the problem pointed out in #1636, you have to:\r\n> \r\n> 1. download the entire GitHub repository with `git clone https://github.com/huggingface/transformers.git` command\r\n> 2. enter to the directory you have just downloaded with `cd transformers` command\r\n> 3. install the repo by running `pip install -e .` command\r\n> 4. go to \"examples\" directory\r\n> 5. now you can run `run_generation.py` script\r\n> \r\n> Hoping it is helpful for developers that want to trying out CTRL model by HuggingFace.\r\n\r\nI using anaconda. When `pip install -e`, it ran but only installed certain package."}}
other: {"actor":{"display_login":"mzjuin"}}