Search is not available for this dataset
repo stringlengths 2 152 ⌀ | file stringlengths 15 239 | code stringlengths 0 58.4M | file_length int64 0 58.4M | avg_line_length float64 0 1.81M | max_line_length int64 0 12.7M | extension_type stringclasses 364
values |
|---|---|---|---|---|---|---|
null | ParlAI-main/tests/test_opt.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import json
import os
import unittest
import parlai.utils.testing as testing_utils
from parlai.core.agents import creat... | 6,549 | 29.751174 | 87 | py |
null | ParlAI-main/tests/test_other_scripts.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Catch all for a number of "other" scripts.
"""
import os
import unittest
from parlai.core.message import Message
fr... | 9,824 | 34.215054 | 87 | py |
null | ParlAI-main/tests/test_params.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test ParlaiParser and other opt/params.py code.
"""
import os
import json
import unittest
from parlai.core.params i... | 12,530 | 34.298592 | 88 | py |
null | ParlAI-main/tests/test_repeat_query_agent.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Unit tests for RepeatQueryAgent.
"""
import unittest
from parlai.core.agents import create_agent
from parlai.core.m... | 5,157 | 40.596774 | 87 | py |
null | ParlAI-main/tests/test_script.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import sys
import unittest
from unittest.mock import patch
from parlai.core.params import ParlaiParser
import parlai.cor... | 4,689 | 32.028169 | 85 | py |
null | ParlAI-main/tests/test_searchquery_retrievers.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
import unittest
import parlai.utils.testing as testing_utils
from parlai.core.params import ParlaiParser
... | 5,885 | 31.7 | 86 | py |
null | ParlAI-main/tests/test_self_chat.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from tempfile import NamedTemporaryFile
import unittest
from parlai.scripts.self_chat import SelfChat
import parlai.uti... | 1,656 | 30.865385 | 83 | py |
null | ParlAI-main/tests/test_seq2seq.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
BATCH_SIZE = 16
NUM_EPOCHS = 10
LR = 1
class TestSeq2Seq... | 3,342 | 29.669725 | 65 | py |
null | ParlAI-main/tests/test_starspace.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import unittest
import parlai.utils.testing as testing_utils
from parlai.scripts.build_candidates import Build... | 2,332 | 33.308824 | 82 | py |
null | ParlAI-main/tests/test_ta_inheritence.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Inheritance around add_cmdline_args can be tricky.
This serves as an example, and verifies inheritence is behaving ... | 2,764 | 31.151163 | 88 | py |
null | ParlAI-main/tests/test_teachers.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test Teachers.
A module for testing various teacher types in ParlAI
"""
import os
import unittest
from parlai.utils... | 16,792 | 35.269978 | 111 | py |
null | ParlAI-main/tests/test_tfidf_retriever.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.agents import create_agent_from_model_file
import parlai.utils.testing as testing_utils
import os
impo... | 5,837 | 32.551724 | 79 | py |
null | ParlAI-main/tests/test_tga.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test TorchGeneratorAgent.
"""
import unittest
import math
import torch
from parlai.core.agents import create_agent
fr... | 19,769 | 39.931677 | 163 | py |
null | ParlAI-main/tests/test_torch_agent.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Unit tests for TorchAgent.
"""
import os
import unittest
from parlai.core.agents import create_agent_from_shared
fr... | 45,641 | 37.976943 | 88 | py |
null | ParlAI-main/tests/test_tra.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test TorchRankerAgent.
"""
import os
import pytest
import unittest
import parlai.utils.testing as testing_utils
fro... | 7,136 | 32.824645 | 87 | py |
null | ParlAI-main/tests/test_train_model.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Basic tests that ensure train_model.py behaves in predictable ways.
"""
import os
import unittest
import json
import... | 15,449 | 36.5 | 126 | py |
null | ParlAI-main/tests/test_transformers.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test many variants of transformers.
"""
import os
import torch
import unittest
from unittest.mock import MagicMock
... | 41,442 | 33.914069 | 107 | py |
null | ParlAI-main/tests/test_unigram.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
class TestUnigram(unittest.TestCase):
def test_unigra... | 889 | 27.709677 | 81 | py |
null | ParlAI-main/tests/test_utils.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.opt import Opt
from parlai.utils.misc import Timer, round_sigfigs, set_namedtuple_defaults, nice_report... | 9,336 | 34.773946 | 156 | py |
null | ParlAI-main/tests/test_utils_torch.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Unit tests for parlai.utils.torch.
"""
import torch
import numpy as np
import unittest
from parlai.utils.torch impo... | 10,195 | 35.544803 | 87 | py |
null | ParlAI-main/tests/test_wrapper.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.agents.repeat_label.repeat_label import RepeatLabelAgent
from parlai.core.worlds import cre... | 1,646 | 31.294118 | 75 | py |
null | ParlAI-main/tests/test_zootasks.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test common developer mistakes in the model zoo and task list.
Mostly just ensures the docs will output nicely.
"""... | 4,972 | 31.933775 | 88 | py |
null | ParlAI-main/tests/crowdsourcing/test_acceptability.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test components of specific crowdsourcing tasks.
"""
import unittest
from parlai.crowdsourcing.utils.acceptability i... | 4,966 | 38.420635 | 87 | py |
null | ParlAI-main/tests/crowdsourcing/test_analysis.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from typing import Any, Dict, List
from parlai.crowdsourcing.utils.analysis import AbstractResultsCompil... | 4,125 | 29.338235 | 98 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/test_chat_demo.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the chat demo crowdsourcing task.
"""
import os
import unittest
import parlai.utils.testing ... | 10,144 | 35.103203 | 176 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_acute_eval.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the ACUTE-Eval crowdsourcing task.
"""
import unittest
import pytest
from pytest_regression... | 2,073 | 30.424242 | 88 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_dataset.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the Fast ACUTE crowdsourcing task.
"""
import shutil
import tempfile
import unittest
import ... | 3,080 | 31.431579 | 110 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_logs.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the Fast ACUTE crowdsourcing task.
"""
import json
import os
import shutil
import tempfile
im... | 3,491 | 30.459459 | 87 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_self_chat.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the Fast ACUTE crowdsourcing task.
"""
import os
import shutil
import tempfile
import unittes... | 2,606 | 28.965517 | 85 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_acute_eval/test_base_task.yml | inputs:
- pair_id: 0
pairing_dict:
correct_answer: modela
dialogue_dicts:
- dialogue:
- id: modela
text: Hello how are you?
- id: human_evaluator
text: I'm well, how about yourself?
- id: modela
text: Good, just reading a book.
- id: human_evaluator
... | 6,203 | 27.990654 | 86 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_dataset/test_agent_state.yml | inputs:
- pair_id: 0
pairing_dict:
correct_answer: human_as_model
dialogue_dicts:
- dialogue:
- id: human_evaluator
text: Hi how are you?
- id: bad_model
text: I don't know
- id: human_evaluator
text: Ok, what do you like to do?
- id: bad_model
text:... | 19,638 | 35.301294 | 85 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_logs/test_agent_state.yml | inputs:
- pair_id: 0
pairing_dict:
correct_answer: human_as_model
dialogue_dicts:
- dialogue:
- id: human_evaluator
text: Hi how are you?
- id: bad_model
text: I don't know
- id: human_evaluator
text: Ok, what do you like to do?
- id: bad_model
text:... | 25,716 | 37.67218 | 89 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/acute_eval/test_fast_acute_self_chat/test_agent_state.yml | inputs:
- pair_id: 0
pairing_dict:
correct_answer: human_as_model
dialogue_dicts:
- dialogue:
- id: human_evaluator
text: Hi how are you?
- id: bad_model
text: I don't know
- id: human_evaluator
text: Ok, what do you like to do?
- id: bad_model
text:... | 25,716 | 37.67218 | 89 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/dialcrowd/test_dialcrowd.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for DialCrowd.
"""
import json
import os
import unittest
import pytest
from pytest_regressions.d... | 2,254 | 26.839506 | 88 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/dialcrowd/hydra_configs/conf/example.yml | #@package _global_
defaults:
- /mephisto/blueprint: dialcrowd_static_blueprint
- /mephisto/architect: local
- /mephisto/provider: mock
mephisto:
blueprint:
data_jsonl: ${task_dir}/data.jsonl
extra_source_dir: ${task_dir}/webapp/src/static
subtasks_per_unit: 4
task_source: ${task_dir}/webapp/buil... | 943 | 33.962963 | 87 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/dialcrowd/test_dialcrowd/test_dialcrowd.yml | inputs:
- category: []
id: 1
sentences:
- please tell me my in-person transactions for the last three days using my debit
card
- category: []
id: 2
sentences:
- send $5 from savings to checking
- category: []
id: 3
sentences:
- is there enough money in my bank of hawaii for vacation
- category: []... | 2,844 | 23.525862 | 85 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/model_chat/test_image_stack.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test the stack that keeps track of model image chats.
"""
import random
import numpy as np
import torch
from pytest... | 2,464 | 31.012987 | 87 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/model_chat/test_model_chat.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the model chat crowdsourcing task.
"""
import glob
import json
import os
import unittest
imp... | 5,875 | 34.612121 | 104 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/model_chat/test_model_chat_analysis.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test the analysis code for the model chat task.
"""
import glob
import json
import os
import re
from typing import A... | 6,342 | 36.311765 | 88 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/model_chat/test_model_image_chat.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the model image chat crowdsourcing task.
"""
import glob
import json
import os
import pickle
... | 6,502 | 37.02924 | 92 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/qa_data_collection/test_qa_data_collection.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the QA data collection crowdsourcing task.
"""
import json
import os
import unittest
# Inpu... | 3,323 | 33.625 | 88 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/turn_annotations_static/test_turn_annotations_static.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
End-to-end testing for the chat demo crowdsourcing task.
"""
import json
import os
import unittest
from typing impor... | 4,864 | 31.871622 | 126 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/turn_annotations_static/test_turn_annotations_static_analysis.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test components of specific crowdsourcing tasks.
"""
import json
import os
import unittest
import pandas as pd
imp... | 5,769 | 36.467532 | 93 | py |
null | ParlAI-main/tests/crowdsourcing/tasks/turn_annotations_static/test_turn_annotations_static/test_in_flight_qa.yml | inputs:
- - agent_idx: 0
do_annotate: false
other_metadata: null
text: Hi!
- agent_idx: 1
do_annotate: true
other_metadata: null
text: I'm not sure if I should upvote you or downvote you. I'll go with upvote.
- agent_idx: 0
do_annotate: false
other_metadata: null
text: How are yo... | 34,750 | 26.91245 | 89 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/turn_annotations_static/test_turn_annotations_static/test_in_flight_qa_annotation_file.yml | inputs:
- - agent_idx: 0
do_annotate: false
other_metadata: null
text: Hi!
- agent_idx: 1
do_annotate: true
other_metadata: null
text: I'm not sure if I should upvote you or downvote you. I'll go with upvote.
- - agent_idx: 0
do_annotate: false
other_metadata: null
text: Hi!
- ag... | 10,558 | 26.641361 | 85 | yml |
null | ParlAI-main/tests/crowdsourcing/tasks/turn_annotations_static/test_turn_annotations_static/test_no_in_flight_qa.yml | inputs:
- - agent_idx: 0
do_annotate: false
other_metadata: null
text: Hi!
- agent_idx: 1
do_annotate: true
other_metadata: null
text: I'm not sure if I should upvote you or downvote you. I'll go with upvote.
- agent_idx: 0
do_annotate: false
other_metadata: null
text: How are yo... | 32,501 | 26.898712 | 89 | yml |
null | ParlAI-main/tests/nightly/cpu/test_alice.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Download and build the data if it does not exist.
import unittest
import parlai.utils.testing as testing_utils
class... | 641 | 26.913043 | 83 | py |
null | ParlAI-main/tests/nightly/cpu/test_roscoe.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import patch
import numpy as np
try:
import transformers # noqa
from senten... | 4,230 | 33.966942 | 86 | py |
null | ParlAI-main/tests/nightly/cpu/test_urls.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# Download and build the data if it does not exist.
import unittest
import importlib
from parlai.tasks.task_list import ... | 1,617 | 32.020408 | 86 | py |
null | ParlAI-main/tests/nightly/gpu/test_bart.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import unittest
from parlai.core.agents import create_agent
from parlai.core.params import ParlaiParser
impor... | 3,295 | 30.692308 | 79 | py |
null | ParlAI-main/tests/nightly/gpu/test_bb2.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import torch.cuda
import unittest
from parlai.core.agents import create_agent
import parlai.utils.testing as... | 10,106 | 28.991098 | 84 | py |
null | ParlAI-main/tests/nightly/gpu/test_bb3.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import random
import time
from typing import List, Union, Optional
import unittest
from parlai.core.agents ... | 25,129 | 38.762658 | 88 | py |
null | ParlAI-main/tests/nightly/gpu/test_bert.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
import torch
@testing_utils.skipUnlessGPU
class TestBertM... | 2,675 | 29.409091 | 84 | py |
null | ParlAI-main/tests/nightly/gpu/test_blended_skill_talk_gpu.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.utils import testing as testing_utils
SHARED_OPTS = {'batchsize': 16, 'task': 'blended_sk... | 3,048 | 29.188119 | 83 | py |
null | ParlAI-main/tests/nightly/gpu/test_dialogpt.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
from parlai.core.agents import create_agent
@testing_util... | 4,894 | 32.993056 | 98 | py |
null | ParlAI-main/tests/nightly/gpu/test_dialogue_bias.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test models with reduced bias.
"""
import unittest
import parlai.utils.testing as testing_utils
from parlai.core.o... | 1,741 | 31.867925 | 88 | py |
null | ParlAI-main/tests/nightly/gpu/test_dodeca.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
WOW_OPTIONS = {
'task': 'wizard_of_wikipedia:Generato... | 2,341 | 26.880952 | 76 | py |
null | ParlAI-main/tests/nightly/gpu/test_gpt2.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.agents import create_agent
import parlai.utils.testing as testing_utils
import parlai.s... | 6,929 | 34.357143 | 83 | py |
null | ParlAI-main/tests/nightly/gpu/test_light_whoami.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.message import Message
from parlai.core.params import ParlaiParser, Opt
from parlai.cor... | 20,856 | 35.655536 | 183 | py |
null | ParlAI-main/tests/nightly/gpu/test_rag.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import os
import torch
import torch.cuda
from typing import Optional
import unittest
from parlai.core.build_... | 23,762 | 32.234965 | 97 | py |
null | ParlAI-main/tests/nightly/gpu/test_safety_modules.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.utils.safety import OffensiveLanguageClassifier
from parlai.utils.safety import OffensiveStringMatcher
from ... | 1,447 | 30.478261 | 84 | py |
null | ParlAI-main/tests/nightly/gpu/test_seeker.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.scripts.eval_model as ems
from parlai.scripts.self_chat import SelfChat
import parlai.util... | 3,977 | 30.322835 | 112 | py |
null | ParlAI-main/tests/nightly/gpu/test_style_gen.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test agents used with style-controlled generation.
"""
import unittest
import parlai.utils.testing as testing_utils... | 4,030 | 34.359649 | 88 | py |
null | ParlAI-main/tests/nightly/gpu/test_t5.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Shamelessly copying relevant integration tests from HuggingFace.
https://github.com/huggingface/transformers/blob/ma... | 29,275 | 91.062893 | 7,207 | py |
null | ParlAI-main/tests/nightly/gpu/test_torchscript.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Unit tests for exporting models via TorchScript (i.e. JIT compilation).
These do not require GPUs, but they are in ... | 10,034 | 37.155894 | 92 | py |
null | ParlAI-main/tests/nightly/gpu/test_transresnet.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test for Transresnet Pretrained Model.
"""
import unittest
import parlai.scripts.display_data as display_data
import... | 1,534 | 27.425926 | 74 | py |
null | ParlAI-main/tests/nightly/gpu/test_transresnet_multimodal.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test for Transresnet Multimodal Pretrained Model.
"""
import unittest
import parlai.scripts.display_data as display_... | 1,781 | 27.285714 | 83 | py |
null | ParlAI-main/tests/nightly/gpu/test_tutorial_generator.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
class TestTutorialTransformerGenerator(unittest.TestCase)... | 865 | 32.307692 | 73 | py |
null | ParlAI-main/tests/nightly/gpu/test_unlikelihood.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import unittest
import parlai.utils.testing as testing_utils
"""
Integration tests for the Dialogue Unlikeliho... | 9,317 | 36.572581 | 108 | py |
null | ParlAI-main/tests/nightly/gpu/test_wizard.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.core.agents import create_agent
import unittest
import parlai.scripts.display_data as display_data
from parl... | 4,036 | 34.104348 | 113 | py |
null | ParlAI-main/tests/nightly/gpu/anti_scaling/test_anti_scaling.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test code for anti-scaling transformer/generator models.
"""
import random
from abc import ABC, abstractmethod
from... | 7,562 | 29.373494 | 88 | py |
null | ParlAI-main/tests/nightly/gpu/anti_scaling/test_anti_scaling/bart_narrow.yml | dec_emb_loss: 0.0151884
dec_hid_loss: 0.662956
dec_self_attn_loss: 497.628
enc_dec_attn_loss: 230.709
enc_emb_loss: 0.0109334
enc_hid_loss: 0.0423955
enc_loss: 0.0415342
enc_self_attn_loss: 3.48364
loss: 11.8679
pred_loss: 7.02967
| 231 | 20.090909 | 27 | yml |
null | ParlAI-main/tests/nightly/gpu/anti_scaling/test_anti_scaling/bart_wide.yml | dec_hid_loss: 2.3451
enc_hid_loss: 0.0261144
enc_loss: 0.0261144
loss: 36.9967
pred_loss: 33.4203
| 98 | 15.5 | 23 | yml |
null | ParlAI-main/tests/nightly/gpu/anti_scaling/test_anti_scaling/transformer_narrow.yml | dec_emb_loss: 0.00679102
dec_hid_loss: 36.1833
dec_self_attn_loss: 2.16121
enc_dec_attn_loss: 10.2653
enc_emb_loss: 0.00210945
enc_hid_loss: 0.279337
enc_loss: 0.284342
enc_self_attn_loss: 371.567
loss: 11.7943
pred_loss: 6.80161
| 230 | 20 | 27 | yml |
null | ParlAI-main/tests/nightly/gpu/anti_scaling/test_anti_scaling/transformer_wide.yml | dec_hid_loss: 76.1246
enc_hid_loss: 0.440789
enc_loss: 0.440789
loss: 21.2455
pred_loss: 16.9862
| 97 | 15.333333 | 22 | yml |
null | ParlAI-main/tests/tasks/test_blended_skill_talk.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import patch
import parlai.utils.testing as testing_utils
from parlai.agents.repeat_... | 21,769 | 52.488943 | 1,402 | py |
null | ParlAI-main/tests/tasks/test_cmu_dog.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List
import unittest
from parlai.scripts.display_data import setup_args
from parlai.core.teachers imp... | 1,644 | 36.386364 | 80 | py |
null | ParlAI-main/tests/tasks/test_empathetic_dialogues.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.opt import Opt
from parlai.tasks.empathetic_dialogues.agents import EmpatheticDialogue... | 26,130 | 74.08908 | 409 | py |
null | ParlAI-main/tests/tasks/test_genderation_bias.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.message import Message
from parlai.core.params import ParlaiParser
from parlai.tasks.ge... | 1,795 | 33.538462 | 76 | py |
null | ParlAI-main/tests/tasks/test_igc.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import itertools
import parlai.utils.testing as testing_utils
from typing import Dict, List, Tuple, Uni... | 2,409 | 29.506329 | 83 | py |
null | ParlAI-main/tests/tasks/test_light.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
from parlai.agents.repeat_label.repeat_label import Repeat... | 1,318 | 29.674419 | 83 | py |
null | ParlAI-main/tests/tasks/test_style_gen_teachers.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import parlai.utils.testing as testing_utils
from parlai.agents.repeat_label.repeat_label import Repeat... | 7,952 | 52.02 | 502 | py |
null | ParlAI-main/tests/tasks/test_wizard_of_internet.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.scripts.display_data import setup_args
from parlai.utils.testing import display_data
import p... | 4,524 | 31.321429 | 85 | py |
null | ParlAI-main/tests/tasks/test_wizard_of_wikipedia.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.scripts.display_data import display_data as display, setup_args
from parlai.agents.repeat_label.repeat_label ... | 7,694 | 34.460829 | 97 | py |
null | ParlAI-main/tests/tasks/convai2/test_convai2_worlds.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import patch
import parlai.utils.testing as testing_utils
from parlai.agents.repeat_... | 1,532 | 34.651163 | 71 | py |
null | ParlAI-main/tests/tasks/convai_chitchat/TeacherTest.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import os
import json
import unittest
from parlai.tasks.convai_chitchat.agents import DefaultTeacher
__location__ = os.... | 1,451 | 33.571429 | 85 | py |
null | ParlAI-main/tests/tasks/reasoning_teacher/test_abstract_reasoning_teacher.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.params import ParlaiParser
import parlai.utils.testing as testing_utils
from parlai.task... | 5,087 | 30.02439 | 123 | py |
null | ParlAI-main/tests/tasks/reasoning_teacher/test_math_dataset_step_by_step_teacher.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests for AbstractReasoningTeacher.
"""
import unittest
from parlai.core.params import ParlaiParser
try:
import ... | 1,852 | 29.883333 | 110 | py |
null | ParlAI-main/tests/tasks/reasoning_teacher/test_question_answer.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from parlai.core.params import ParlaiParser
import parlai.utils.testing as testing_utils
from parlai.task... | 1,989 | 25.533333 | 86 | py |
null | ParlAI-main/tests/tasks/reasoning_teacher/test_step_by_step.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests for AbstractReasoningTeacher.
"""
from typing import List
import unittest
from parlai.core.params import Parlai... | 8,582 | 35.21519 | 134 | py |
null | ParlAI-main/tests/tasks/self_chat/test_worlds.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.agents.repeat_label.repeat_label import RepeatLabelAgent
from parlai.core.worlds import create_task
from parl... | 2,628 | 32.705128 | 80 | py |
null | ParlAI-main/tests/tod/__init__.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
| 199 | 32.333333 | 65 | py |
null | ParlAI-main/tests/tod/test_tod_agents_and_teachers.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests teachers + agent implementations, assuming parser to conversations format has
already been done and teachers/a... | 13,552 | 34.949602 | 88 | py |
null | ParlAI-main/tests/tod/test_tod_teacher_metrics.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
File that includes tests for teacher metrics.
"""
import unittest
from math import isnan
from parlai.core.metrics ... | 2,430 | 30.986842 | 84 | py |
null | ParlAI-main/tests/tod/test_tod_world_and_script.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests tod world + script, notably for batching, by comparing saved script logs to the
data that should have been gen... | 9,206 | 35.535714 | 114 | py |
null | ParlAI-main/tests/tod/test_tod_world_metrics.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Test world metrics + world metrics handlers against dummy conversations.
"""
import unittest
from parlai.core.tod.... | 9,485 | 37.718367 | 88 | py |
null | ParlAI-main/tests/tod/test_tod_world_metrics_in_script.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests tod world metrics in the full script, *including* making the script properly set
up the agents on its own.
Us... | 9,839 | 34.142857 | 94 | py |
null | ParlAI-main/tests/tod/test_tod_world_script_metrics.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Tests tod world metrics in the full script, *without* making the script properly set up
the agents on its own.
Use ... | 5,227 | 32.948052 | 88 | py |
null | ParlAI-main/website/README.md | This is the code to build the parlai website.
- `generate.py`: does the actual rendering
- `static`: assets in this folder will be copied verbatim to parl.ai/static/
- `templates`: contains html templates for a variety of pages
| 229 | 37.333333 | 76 | md |
null | ParlAI-main/website/generate.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Builds the ParlAI website.
"""
import os
import git
import markdown
import shutil
from mdx_gfm import PartialGithub... | 4,861 | 31.851351 | 87 | py |