internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: facebookresearch/ParlAI

Issue:
projects/convai2/interactive.py not using new message force_set feature
**Bug description**
The code hasn't been updated for the force_set.

**Reproduction steps**
python projects/convai2/interactive.py -mf models:convai2/seq2seq/convai2_self_seq2seq_model -m legacy:seq2seq:0 --no_cuda

**Expected behavior**
to just chat

**Logs**

```
Traceback (most recent call last):
  File "projects/convai2/interactive.py", line 126, in <module>
    interactive(parser.parse_args(print_args=False), print_parser=parser)
  File "projects/convai2/interactive.py", line 105, in interactive
    acts[0]['text'] = bot_persona + acts[0].get('text', 'hi')
  File "/home/ubuntu/anaconda3/envs/pytorch_p36/lib/python3.6/site-packages/parlai-0.1.0-py3.6.egg/parlai/core/message.py", line 26, in __setitem__
    'please use the function `force_set(key, value)`.'.format(key)
RuntimeError: Message already contains key `text`. If this was intentional, please use the function `force_set(key, value)`.
```

**Additional context**
possible fix
```
index 61ead742..9d478d75 100644
--- a/projects/convai2/interactive.py
+++ b/projects/convai2/interactive.py
@@ -102,7 +102,8 @@ def interactive(opt, print_parser=None):
         acts[0] = agents[0].act()
         # add the persona on to the first message
         if cnt == 0:
-            acts[0]['text'] = bot_persona + acts[0].get('text', 'hi')
+            #acts[0]['text'] = bot_persona + acts[0].get('text', 'hi')
+            acts[0].force_set('text',bot_persona + acts[0].get('text', 'hi'))
         agents[1].observe(acts[0])

```



Discussion:
Yes, that's the correct patch. Feel free to submit (deleting the comment out line of course).

Resolving patch:
diff --git a/projects/convai2/interactive.py b/projects/convai2/interactive.py
--- a/projects/convai2/interactive.py
+++ b/projects/convai2/interactive.py
@@ -102,7 +102,7 @@ def get_new_personas():
         acts[0] = agents[0].act()
         # add the persona on to the first message
         if cnt == 0:
-            acts[0]['text'] = bot_persona + acts[0].get('text', 'hi')
+            acts[0].force_set('text', bot_persona + acts[0].get('text', 'hi'))
         agents[1].observe(acts[0])
         acts[1] = agents[1].act()
         agents[0].observe(acts[1])


Test patch:
Repository: facebookresearch/ParlAI

Issue:
No module named parlai.scripts.train
**Bug description**
Even after running **python3 setup.py develop**, I am getting this error "No module named parlai.scripts.train"


**Reproduction steps**
Run
 python3 -m parlai.scripts.train -m seq2seq -t coqa -mf /tmp/model -bs 10

**Expected behavior**
Train the model without this error.

**Logs**
Please paste the command line output:
ubuntu@td-parlai-large:~/ParlAI$ python3 -m parlai.scripts.train -m seq2seq -t coqa -mf /tmp/model -bs 10
/usr/bin/python3: No module named parlai.scripts.train

```
Output goes here
```

**Additional context**
I am not sure if I should or can modify PYTHONPATH by myself. I tried removing the whole repo and running setup.py again, still didn't work.

I see that since my machine has two versions of Python, I can find the module in 2.7, but not in 3.6:

ubuntu@td-parlai-large:~/ParlAI$ python3 -m parlai.scripts.train
/usr/bin/python3: No module named parlai.scripts.train
ubuntu@td-parlai-large:~/ParlAI$ python -m parlai.scripts.train
Traceback (most recent call last):
  File "/usr/lib/python2.7/runpy.py", line 163, in _run_module_as_main
    mod_name, _Error)
  File "/usr/lib/python2.7/runpy.py", line 102, in _get_module_details
    loader = get_loader(mod_name)
  File "/usr/lib/python2.7/pkgutil.py", line 462, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python2.7/pkgutil.py", line 472, in find_loader
    for importer in iter_importers(fullname):
  File "/usr/lib/python2.7/pkgutil.py", line 428, in iter_importers
    __import__(pkg)
  File "parlai/__init__.py", line 9, in <module>
    raise RuntimeError('ParlAI requires Python 3.')
RuntimeError: ParlAI requires Python 3.

Any way to install just in python3.6?

Update: Even after removing python2.7, it didn't work.
The weird thing is
python -m parlai.scripts.interactive --model tfidf_retriever -mf zoo:wikipedia_full/tfidf_retriever/model
runs perfectly.


Discussion:
It's `parlai.scripts.train_model`, not `.train`. If there was a part of the docs that said `train`, please let me know where; we should update that immediately.
https://www.parl.ai/docs/cli_usage.html#module-parlai.scripts.train_model

On careful observation,  it's just the examples, not the actual command that's different 

Resolving patch:
diff --git a/parlai/scripts/train_model.py b/parlai/scripts/train_model.py
--- a/parlai/scripts/train_model.py
+++ b/parlai/scripts/train_model.py
@@ -17,9 +17,9 @@
 --------
 .. code-block:: shell
 
-  python -m parlai.scripts.train -m ir_baseline -t dialog_babi:Task:1 -mf /tmp/model
-  python -m parlai.scripts.train -m seq2seq -t babi:Task10k:1 -mf '/tmp/model' -bs 32 -lr 0.5 -hs 128
-  python -m parlai.scripts.train -m drqa -t babi:Task10k:1 -mf /tmp/model -bs 10
+  python -m parlai.scripts.train_model -m ir_baseline -t dialog_babi:Task:1 -mf /tmp/model
+  python -m parlai.scripts.train_model -m seq2seq -t babi:Task10k:1 -mf '/tmp/model' -bs 32 -lr 0.5 -hs 128
+  python -m parlai.scripts.train_model -m drqa -t babi:Task10k:1 -mf /tmp/model -bs 10
 """  # noqa: E501
 
 # TODO List:


Test patch:
Repository: facebookresearch/ParlAI

Issue:
Throw error if bool is used in add_argument?
in our `ParlaiParser.add_argument`, if the type argument is a literal bool, we should either throw an error or maybe smartly switch to `'bool'` with a warning?


Discussion:

Resolving patch:
diff --git a/parlai/core/params.py b/parlai/core/params.py
--- a/parlai/core/params.py
+++ b/parlai/core/params.py
@@ -1162,6 +1162,9 @@ def _handle_custom_options(self, kwargs):
             hidden = kwargs.pop('hidden')
             if hidden:
                 kwargs['help'] = argparse.SUPPRESS
+        if 'type' in kwargs and kwargs['type'] is bool:
+            # common error, we really want simple form
+            kwargs['type'] = 'bool'
         return kwargs, action_attr
 
     def add_argument(self, *args, **kwargs):


Test patch:
diff --git a/tests/test_params.py b/tests/test_params.py
--- a/tests/test_params.py
+++ b/tests/test_params.py
@@ -120,6 +120,46 @@ def test_parse_kwargs(self):
             parser = ParlaiParser(True, True)
             parser.parse_kwargs(model='transformer/generator', fake_arg='foo')
 
+    def test_bool(self):
+        """
+        test add_argument(type=bool)
+        """
+        parser = ParlaiParser(True, True)
+        parser.add_argument('--foo', type=bool)
+        opt = parser.parse_args(['--foo', 'true'])
+        assert opt['foo'] is True
+        opt = parser.parse_args(['--foo', 'False'])
+        assert opt['foo'] is False
+        opt = parser.parse_args(['--foo', '0'])
+        assert opt['foo'] is False
+
+        group = parser.add_argument_group('foo container')
+        group.add_argument('--bar', type=bool)
+        opt = parser.parse_args(['--bar', 'true'])
+        assert opt['bar'] is True
+        opt = parser.parse_args(['--bar', 'False'])
+        assert opt['bar'] is False
+        opt = parser.parse_args(['--bar', '0'])
+        assert opt['bar'] is False
+
+        parser = ParlaiParser(True, True)
+        parser.add_argument('--foo', type='bool')
+        opt = parser.parse_args(['--foo', 'true'])
+        assert opt['foo'] is True
+        opt = parser.parse_args(['--foo', 'False'])
+        assert opt['foo'] is False
+        opt = parser.parse_args(['--foo', '0'])
+        assert opt['foo'] is False
+
+        group = parser.add_argument_group('foo container')
+        group.add_argument('--bar', type='bool')
+        opt = parser.parse_args(['--bar', 'true'])
+        assert opt['bar'] is True
+        opt = parser.parse_args(['--bar', 'False'])
+        assert opt['bar'] is False
+        opt = parser.parse_args(['--bar', '0'])
+        assert opt['bar'] is False
+
 
 if __name__ == '__main__':
     unittest.main()
Repository: facebookresearch/ParlAI

Issue:
Problem trying to install 
Use this to open other questions or issues, and provide context here.
Hi, I'm kinda new to this, when I was trying to install it, I got the following error: 

 File "setup.py", line 30
    version=f'0.1.{DATE}{BUILD}',
                               ^
SyntaxError: invalid syntax

I used the command: 

git clone https://github.com/facebookresearch/ParlAI.git
cd ParlAI; python setup.py develop

Any Idea why?

Thank you. 


Discussion:
me either. maybe 'f' is miss word. but i'm not sure
We only support python 3.6 or newer.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -10,7 +10,7 @@
 
 from setuptools import setup, find_packages
 
-BUILD = ''  # if multiple in one day, use "dev0", "dev1", ...
+BUILD = ''  # test by setting to ".dev0" if multiple in one day, use ".dev1", ...
 DATE = datetime.date.today().isoformat().replace('-', '')
 
 if sys.version_info < (3, 6):
@@ -27,7 +27,7 @@
 if __name__ == '__main__':
     setup(
         name='parlai',
-        version=f'0.1.{DATE}{BUILD}',
+        version='0.1.{DATE}{BUILD}'.format(DATE=DATE, BUILD=BUILD),
         description='Unified platform for dialogue research.',
         long_description=readme,
         long_description_content_type='text/markdown',
@@ -39,6 +39,7 @@
         ),
         install_requires=reqs.strip().split('\n'),
         include_package_data=True,
+        package_data={'': ['*.txt', '*.md']},
         entry_points={"flake8.extension": ["PAI = parlai.utils.flake8:ParlAIChecker"]},
         classifiers=[
             "Programming Language :: Python :: 3",


Test patch:
Repository: facebookresearch/ParlAI

Issue:
'PathManagerBase' object has no attribute 'makedirs'
In attempting to create the tensorboard directory with PathManager we're calling a nonexistent function.

To repro:
```bash
$ python -m parlai.scripts.train_model -t personachat -m transformer/ranker -mf /tmp/model_tr6 --n-layers 1 --embedding-size 300 --ffn-size 600 --n-heads 4 --num-epochs 2 -veps 0.25 -bs 64 -lr 0.001 --dropout 0.1 --embedding-type fasttext_cc --candidates batch --tensorboard-log true
```

Exception hit:
```
File "/Users/spoff/ParlAI/parlai/core/logs.py", line 56, in __init__
    PathManager.makedirs(tbpath)
AttributeError: 'PathManagerBase' object has no attribute 'makedirs'
```


Discussion:
Shoot, it's supposed to be mkdirs. Please submit a patch.

Resolving patch:
diff --git a/parlai/__init__.py b/parlai/__init__.py
--- a/parlai/__init__.py
+++ b/parlai/__init__.py
@@ -4,4 +4,4 @@
 # This source code is licensed under the MIT license found in the
 # LICENSE file in the root directory of this source tree.
 
-__version__ = '0.9.1'
+__version__ = '0.9.2'
diff --git a/parlai/core/logs.py b/parlai/core/logs.py
--- a/parlai/core/logs.py
+++ b/parlai/core/logs.py
@@ -53,7 +53,7 @@ def __init__(self, opt: Opt):
         tbpath = opt['model_file'] + '.tensorboard'
         logging.debug(f'Saving tensorboard logs to: {tbpath}')
         if not PathManager.exists(tbpath):
-            PathManager.makedirs(tbpath)
+            PathManager.mkdirs(tbpath)
         self.writer = SummaryWriter(tbpath, comment=json.dumps(opt))
 
     def log_metrics(self, setting, step, report):
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -9,7 +9,7 @@
 
 from setuptools import setup, find_packages
 
-VERSION = '0.9.1'  # if you update, update parlai/__init__.py too!
+VERSION = '0.9.2'  # if you update, update parlai/__init__.py too!
 
 if sys.version_info < (3, 6):
     sys.exit('Sorry, Python >=3.6 is required for ParlAI.')


Test patch:
Repository: facebookresearch/ParlAI

Issue:
Add --version flag to parlai command
**Is your feature request related to a problem? Please describe.**
Make parlai "super command" conform the unix idiom of a --version flag.

Usecase: A user switching between virtual environments or reading about the release of a new feature should be able to easily identify which version they have on their path.

**Describe the solution you'd like**
```bash
$ parlai --version
parlai version X.X.X
# Optionally any relevant install info (not probably not any)
# Optionally copyright/license info (up to the maintainers whether you want this here or not)
```

**Describe alternatives you've considered**
```bash
$ python -c "import parlai; print(parlai.__version__)"
0.9.2
```
A little less natural


Discussion:

Resolving patch:
diff --git a/parlai/core/script.py b/parlai/core/script.py
--- a/parlai/core/script.py
+++ b/parlai/core/script.py
@@ -17,6 +17,7 @@
 import io
 import argparse
 from typing import List, Optional, Dict, Any
+import parlai
 from parlai.core.opt import Opt
 from parlai.core.params import ParlaiParser, CustomHelpFormatter
 from abc import abstractmethod
@@ -206,7 +207,13 @@ def superscript_main(args=None):
     parser.add_argument(
         '--helpall',
         action='helpall',
-        help='show all commands, including advanced ones.',
+        help='List all commands, including advanced ones.',
+    )
+    parser.add_argument(
+        '--version',
+        action='version',
+        version=get_version_string(),
+        help='Prints version info and exit.',
     )
     parser.set_defaults(super_command=None)
     subparsers = parser.add_subparsers(
@@ -216,13 +223,13 @@ def superscript_main(args=None):
         'help',
         aliases=['h'],
         help=argparse.SUPPRESS,
-        description="List the main commands",
+        description='List the main commands.',
     )
     hparser.set_defaults(super_command='help')
     hparser = subparsers.add_parser(
         'helpall',
         help=argparse.SUPPRESS,
-        description="List all commands, including advanced ones.",
+        description='List all commands, including advanced ones.',
     )
     hparser.set_defaults(super_command='helpall')
 
@@ -265,7 +272,13 @@ def superscript_main(args=None):
     cmd = opt.pop('super_command')
     if cmd == 'helpall':
         parser.print_helpall()
+    elif cmd == 'versioninfo':
+        exit(0)
     elif cmd == 'help' or cmd is None:
         parser.print_help()
     elif cmd is not None:
         return SCRIPT_REGISTRY[cmd].klass._run_from_parser_and_opt(opt, parser)
+
+
+def get_version_string() -> str:
+    return f"ParlAI version {parlai.__version__}"


Test patch:
Repository: facebookresearch/ParlAI

Issue:
BERT classifier doesn't work under distributed_train
The default tokenization is re, I think it's building the dictionary along the way...

**Logs**
Please paste the command line output:

```
ValueError: Dictionaries should be pre-built before distributed train.
ValueError: Dictionaries should be pre-built before distributed train.
```




Discussion:
This issue has not had activity in 30 days. Please feel free to reopen if you have more issues. You may apply the "never-stale" tag to prevent this from happening.

Resolving patch:
diff --git a/parlai/agents/bert_ranker/bert_dictionary.py b/parlai/agents/bert_ranker/bert_dictionary.py
--- a/parlai/agents/bert_ranker/bert_dictionary.py
+++ b/parlai/agents/bert_ranker/bert_dictionary.py
@@ -24,6 +24,9 @@ class BertDictionaryAgent(DictionaryAgent):
     Allow to use the Torch Agent with the wordpiece dictionary of Hugging Face.
     """
 
+    def is_prebuit(self):
+        return True
+
     def __init__(self, opt):
         super().__init__(opt)
         # initialize from vocab path


Test patch:
Repository: facebookresearch/ParlAI

Issue:
BST dataset: where is 'mode' for each utterances?
Hi, I have a question about BST dataset (https://arxiv.org/pdf/2004.08449.pdf).
<img width="971" alt="스크린샷 2021-01-03 오후 9 48 39" src="https://user-images.githubusercontent.com/15323600/103478953-7afeea80-4e0d-11eb-9a1d-c5b87b237d48.png">

While the paper and Fig. 1 tell us that each utterance are annotated with the 'mode' (e.g., _PB,K,E,S_),
 I cannot find it in raw BST dataset (i.e., `train.json, valid.json, test.json`) unfortunately :(

Without it, one cannot even reproduce **MT Two-Stage model** in the paper because the model is based on a dialog manager that classifies the mode given utterance.

Is the 'mode' only used for private perhaps?

Thanks.


Discussion:
The modes are derived from a classifier which was trained on the original 3 datasets. See Section 3.2 for details.
Perhaps @EricMichaelSmith could release his pretrained classifier or at least the command to train a fresh one (which shouldn't be hard).
Thanks for the comment in detail :)

But beyond the classifier, the paper says that the authors collected crowdsourced skill annotation in Section 3.1
Table 3 and Figure 1 also explain that each utterance or dialogue is labeled by multiple modes.
Hi! I'm currently looking into whether the two-stage model and/or crowdsourced annotations can be easily open-sourced. I'll reach back out when I have an update on this.

Resolving patch:
diff --git a/parlai/tasks/blended_skill_talk/build.py b/parlai/tasks/blended_skill_talk/build.py
--- a/parlai/tasks/blended_skill_talk/build.py
+++ b/parlai/tasks/blended_skill_talk/build.py
@@ -60,12 +60,18 @@
         '2ee292aa0006ea002e9b23d4f7326fe9e17514ce5793d31fd8d679035d4366a7',
         zipped=False,
     ),
+    build_data.DownloadableFile(
+        'http://parl.ai/downloads/blended_skill_talk/human_annotations.json',
+        'human_annotations.json',
+        'fe76a989d4fdcfa4a5beb214054069ed0abf45f3530eaeb8df38e75f7bb14795',
+        zipped=False,
+    ),
 ]
 
 
 def build(opt):
     dpath = os.path.join(opt['datapath'], 'blended_skill_talk')
-    version = 'v1.4'
+    version = 'v1.5'
 
     if not build_data.built(dpath, version_string=version):
         print('[building data: ' + dpath + ']')


Test patch:
Repository: adfinis/timed-backend

Issue:
Upgrade PostgreSQL to a non EOL version
As per 923f8e23f2e1e30fd43d8ee09c6fbb0d18028013 we seem to be using a PostgreSQL version that was EOLed February 13, 2020.

We should upgrade to a version that is not EOL, basically all versions >9.4 are still in support.

See here for the available versions and their support policy: https://www.postgresql.org/support/versioning/

Once updated the  Helm chart for timed also needs updating. In fact this issue surfaced during updating/implementing the chart: https://github.com/adfinis-sygroup/timed-chart/pull/9#issuecomment-610854977


Discussion:
So you would suggest reverting 923f8e2 and going back to v9.6?
As discussed in chat, we will keep this for the current prod system as the upgrade doesn't work there. We should tackle this once the new aks environment is ready
Postgres should be upgraded and tested on a newer version before releasing new content that builds on a deprecated database. 

Versions currently running in production systems should not influence the development of newer versions. Testing for newer versions should be easy without having clusters everywhere
Yes of course, I will plan the upgrade path to postgres 12 right away.
No changes are needed for supporting anything >9.4.

Resolving patch:
diff --git a/timed/employment/models.py b/timed/employment/models.py
--- a/timed/employment/models.py
+++ b/timed/employment/models.py
@@ -244,7 +244,7 @@ def calculate_worktime(self, start, end):
         3. The expected worktime consists of following elements:
             * Workdays
             * Subtracted by holidays
-            * Multiplicated with the worktime per day of the employment
+            * Multiplied with the worktime per day of the employment
         4. Determine the overtime credit duration within time frame
         5. The reported worktime is the sum of the durations of all reports
            for this user within time frame


Test patch:
Repository: adfinis/timed-backend

Issue:
Static files don't load on test aks
Static files for django admin don't load on the test aks.
Maybe it's an issue with the `STATIC_ROOT` not being correct.
[Gunicorn PR](https://github.com/adfinis-sygroup/timed-backend/commit/a9c9788c327d27b7f18b348db341217716ab6fa3#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5)


Discussion:

Resolving patch:
diff --git a/timed/settings.py b/timed/settings.py
--- a/timed/settings.py
+++ b/timed/settings.py
@@ -83,6 +83,7 @@ def default(default_dev=env.NOTSET, default_prod=env.NOTSET):
     "django.contrib.messages.middleware.MessageMiddleware",
     "django.middleware.clickjacking.XFrameOptionsMiddleware",
     "django_prometheus.middleware.PrometheusAfterMiddleware",
+    "whitenoise.middleware.WhiteNoiseMiddleware",
 ]
 
 ROOT_URLCONF = "timed.urls"
diff --git a/timed/urls.py b/timed/urls.py
--- a/timed/urls.py
+++ b/timed/urls.py
@@ -1,7 +1,5 @@
 """Root URL mapping."""
 
-from django.conf import settings
-from django.conf.urls.static import static
 from django.contrib import admin
 from django.urls import include, re_path
 
@@ -14,4 +12,4 @@
     re_path(r"^api/v1/", include("timed.subscription.urls")),
     re_path(r"^oidc/", include("mozilla_django_oidc.urls")),
     re_path(r"^prometheus/", include("django_prometheus.urls")),
-] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
+]


Test patch:
Repository: chaoss/augur

Issue:
Need Model and worker info for releases worker
The new releases worker needs to have sections added for the model and the worker in the augur.config.json in order to run. 



Discussion:
All that's required to edit the default config is to edit the `default_config` object at the top of `augur/cli/configure.py`. That is where those sections would need to be added. 

Resolving patch:
diff --git a/augur/cli/configure.py b/augur/cli/configure.py
--- a/augur/cli/configure.py
+++ b/augur/cli/configure.py
@@ -164,6 +164,11 @@
                 "switch": 1,
                 "workers": 1
             },
+            "release_worker": {
+                "port": 51100,
+                "switch": 1,
+                "workers": 1
+            },
         },
         "Facade": {
             "check_updates": 1,


Test patch: