forked from facebookresearch/ParlAI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_self_chat.py
31 lines (23 loc) · 943 Bytes
/
test_self_chat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/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.self_chat import SelfChat
class TestSelfChat(unittest.TestCase):
def test_vanilla(self):
SelfChat.main(model='fixed_response', fixed_response='hi')
def test_convai2(self):
SelfChat.main(
task='convai2', model='fixed_response', fixed_response='hi', dt='valid'
)
def test_ed(self):
SelfChat.main(
task='empathetic_dialogues',
model_file='zoo:tutorial_transformer_generator/model',
seed_messages_from_task=True,
)
def test_no_plain_teacher(self):
from parlai.scripts.display_data import DisplayData
with self.assertRaises(RuntimeError):
DisplayData.main(task='self_chat')