diff --git a/tests/data/line/hello14.pdl b/tests/data/line/hello14.pdl index f793d59f..e4cf714e 100644 --- a/tests/data/line/hello14.pdl +++ b/tests/data/line/hello14.pdl @@ -14,7 +14,11 @@ document: spec: int return: - "\nTranslate the sentence '{{ sentence }}' to {{ language }}\n" - - model: ibm/granite-34b-code-instruct + - model: ibm/granite-20b-multilingual + params: + stop_sequences: + - '!' + include_stop_sequence: true - call: translate spec: str args: diff --git a/tests/data/line/hello16.pdl b/tests/data/line/hello16.pdl index 2e532a96..0bd8c38a 100644 --- a/tests/data/line/hello16.pdl +++ b/tests/data/line/hello16.pdl @@ -20,7 +20,7 @@ document: as: document - 'Question: Write a JSON object with 2 fields "bob" and "carol" set to "20" and "30" respectively.' parser: yaml - parameters: + params: decoding_method: greedy stop_sequences: - '}' diff --git a/tests/data/line/hello2.pdl b/tests/data/line/hello2.pdl deleted file mode 100644 index d4eb9138..00000000 --- a/tests/data/line/hello2.pdl +++ /dev/null @@ -1,12 +0,0 @@ -description: Hello world to call into a model -defs: - model: ibm/granite-34b-code-instruct -document: -- Hello, -- model: "{{ model }}" - spec: int - params: - decoding_methods: greedy - stop_sequencess: - - '!' - include_stop_sequence: true \ No newline at end of file diff --git a/tests/data/line/hello25.pdl b/tests/data/line/hello25.pdl index 49a63e0f..b33db116 100644 --- a/tests/data/line/hello25.pdl +++ b/tests/data/line/hello25.pdl @@ -13,7 +13,12 @@ document: language: str return: - "\nTranslate the sentence '{{ sentence1 }}' to {{ language }}\n" - - model: ibm/granite-34b-code-instruct + - model: ibm/granite-20b-multilingual + params: + stop_sequences: + - "!" + - "\n" + include_stop_sequence: true - call: translate spec: str args: diff --git a/tests/data/line/hello27.pdl b/tests/data/line/hello27.pdl deleted file mode 100644 index 413b2022..00000000 --- a/tests/data/line/hello27.pdl +++ /dev/null @@ -1,3 +0,0 @@ -description: including an invalid file -document: - include: tests/data/line/hello2.pdl \ No newline at end of file diff --git a/tests/data/line/hello5.pdl b/tests/data/line/hello5.pdl deleted file mode 100644 index 3501029a..00000000 --- a/tests/data/line/hello5.pdl +++ /dev/null @@ -1,19 +0,0 @@ -description: Hello world showing model chaining -document: -- Hello, -- model: ibm/granite-20b-code-instruct - params: - decoding_method: greedy - stop_sequences: - - '!' - include_stop_sequence: false - def: NAME -- |- - ! - Who is{{ NAME }}? -- model: google/flan-t5-xl - params: - decoding_method: greedy - stop_sequences: - - '!' - include_stop_sequences: false \ No newline at end of file diff --git a/tests/data/line/hello6.pdl b/tests/data/line/hello6.pdl deleted file mode 100644 index 79fe87d6..00000000 --- a/tests/data/line/hello6.pdl +++ /dev/null @@ -1,20 +0,0 @@ -description: Hello world showing model chaining -document: -- Hello, -- model: ibm/granite-20b-code-instruct - params: - decoding_methoda: greedy - foo: bar - stop_sequences: - - '!' - include_stop_sequence: false - def: NAME -- |- - ! - Who is{{ NAME }}? -- model: google/flan-t5-xl - params: - decoding_method: greedy - stop_sequences: - - '!' - include_stop_sequences: false diff --git a/tests/test_line_table.py b/tests/test_line_table.py index f154f66f..61374c35 100644 --- a/tests/test_line_table.py +++ b/tests/test_line_table.py @@ -38,20 +38,6 @@ def test_line1(capsys): do_test(line1, capsys) -line2 = { - "file": "tests/data/line/hello2.pdl", - "errors": [ - "", - "tests/data/line/hello2.pdl:9 - Field not allowed: decoding_methods", - "tests/data/line/hello2.pdl:10 - Field not allowed: stop_sequencess", - ], -} - -# XXX The type checking of BAM parameters is now weaker -# def test_line2(capsys): -# do_test(line2, capsys) - - line3 = { "file": "tests/data/line/hello3.pdl", "errors": [ @@ -81,34 +67,6 @@ def test_line4(capsys): do_test(line4, capsys) -line5 = { - "file": "tests/data/line/hello5.pdl", - "errors": [ - "", - "tests/data/line/hello5.pdl:19 - Field not allowed: include_stop_sequences", - ], -} - -# XXX The type checking of BAM parameters is now weaker -# def test_line5(capsys): -# do_test(line5, capsys) - - -line6 = { - "file": "tests/data/line/hello6.pdl", - "errors": [ - "", - "tests/data/line/hello6.pdl:7 - Field not allowed: foo", - "tests/data/line/hello6.pdl:6 - Field not allowed: decoding_methoda", - "tests/data/line/hello6.pdl:20 - Field not allowed: include_stop_sequences", - ], -} - -# XXX The type checking of BAM parameters is now weaker -# def test_line6(capsys): -# do_test(line6, capsys) - - line7 = { "file": "tests/data/line/hello7.pdl", "errors": [ @@ -209,25 +167,21 @@ def test_line13(capsys): do_test(line13, capsys) -# line14 = { -# "file": "tests/data/line/hello14.pdl", -# "errors": [ -# "", -# "Hello, world!", -# "Translate the sentence 'Hello, World!' to French", -# "Bonjour le monde !", -# "Translate the sentence 'Hello, World!' to German", -# "Hallo Welt!", -# "tests/data/line/hello14.pdl:19 - Type errors in result of function call to translate", # pylint: disable=line-too-long -# "tests/data/line/hello14.pdl:15 - Bonjour le monde !", -# "Translate the sentence 'Hello, world!' to German", -# "Hallo Welt! should be of type ", -# ], -# } +line14 = { + "file": "tests/data/line/hello14.pdl", + "errors": [ + "", + "Hello, World!", + "Translate the sentence 'Hello, World!' to French", + "Bonjour le monde!", + "tests/data/line/hello14.pdl:22 - Type errors in result of function call to translate", + "tests/data/line/hello14.pdl:15 - Bonjour le monde! should be of type ", + ], +} -# def test_line14(capsys): -# do_test(line14, capsys) +def test_line14(capsys): + do_test(line14, capsys) line15 = { @@ -246,19 +200,19 @@ def test_line15(capsys): do_test(line15, capsys) -# line16 = { -# "file": "tests/data/line/hello16.pdl", -# "errors": [ -# "", -# "{'bob': 20, 'carol': 30}", -# "tests/data/line/hello16.pdl:8 - Type errors during spec checking", -# "tests/data/line/hello16.pdl:8 - 30 should be of type ", -# ], -# } +line16 = { + "file": "tests/data/line/hello16.pdl", + "errors": [ + "", + '{"bob": 20, "carol": 30}', + "tests/data/line/hello16.pdl:8 - Type errors during spec checking", + "tests/data/line/hello16.pdl:8 - 30 should be of type ", + ], +} -# def test_line16(capsys): -# do_test(line16, capsys) +def test_line16(capsys): + do_test(line16, capsys) line17 = { @@ -353,40 +307,40 @@ def test_line23(capsys): do_test(line23, capsys) -# line24 = { -# "file": "tests/data/line/hello24.pdl", -# "errors": [ -# "", -# "Hello, world!", -# "tests/data/line/hello24.pdl:21 - 'GEN1' is undefined", -# "tests/data/line/hello24.pdl:22 - 'GEN2' is undefined", -# "tests/data/line/hello24.pdl:20 - Type errors during function call to translate", -# "tests/data/line/hello24.pdl:21 - None should be of type ", -# "tests/data/line/hello24.pdl:22 - None should be of type ", -# "tests/data/line/hello24.pdl:18 - Type errors during spec checking", -# "tests/data/line/hello24.pdl:18 - None should be of type ", -# ], -# } +line24 = { + "file": "tests/data/line/hello24.pdl", + "errors": [ + "", + "Hello, World!", + "tests/data/line/hello24.pdl:21 - 'GEN1' is undefined", + "tests/data/line/hello24.pdl:22 - 'GEN2' is undefined", + "tests/data/line/hello24.pdl:20 - Type errors during function call to translate", + "tests/data/line/hello24.pdl:21 - None should be of type ", + "tests/data/line/hello24.pdl:22 - None should be of type ", + "tests/data/line/hello24.pdl:18 - Type errors during spec checking", + "tests/data/line/hello24.pdl:18 - None should be of type ", + ], +} -# def test_line24(capsys): -# do_test(line24, capsys) +def test_line24(capsys): + do_test(line24, capsys) -# line25 = { -# "file": "tests/data/line/hello25.pdl", -# "errors": [ -# "", -# "Hello, World!", -# "tests/data/line/hello25.pdl:15 - 'sentence1' is undefined", -# "Translate the sentence '{{ sentence1 }}' to {{ language }}", -# "Hello, world!", -# ], -# } +line25 = { + "file": "tests/data/line/hello25.pdl", + "errors": [ + "", + "Hello, World!", + "tests/data/line/hello25.pdl:15 - 'sentence1' is undefined", + "Translate the sentence '{{ sentence1 }}' to {{ language }}", + "{{ translate(sentence1) }}", + ], +} -# def test_line25(capsys): -# do_test(line25, capsys) +def test_line25(capsys): + do_test(line25, capsys) line26 = { @@ -410,24 +364,6 @@ def test_line26(capsys): do_test(line26, capsys) -line27 = { - "file": "tests/data/line/hello27.pdl", - "errors": [ - "", - "", - "tests/data/line/hello27.pdl:3 - Attempting to include invalid yaml: tests/data/line/hello2.pdl", # pylint: disable=line-too-long - "tests/data/line/hello2.pdl:9 - Field not allowed: decoding_methods", - "tests/data/line/hello2.pdl:10 - Field not allowed: stop_sequencess", - "", - "", - ], -} - -# XXX The type checking of BAM parameters is now weaker -# def test_line27(capsys): -# do_test(line27, capsys) - - line28 = { "file": "tests/data/line/hello28.pdl", "errors": [