Skip to content

Commit ab65614

Browse files
committed
fixing test cases in light of changes in watsonx
Signed-off-by: Mandana Vaziri <[email protected]>
1 parent 7c5fc2c commit ab65614

File tree

5 files changed

+25
-30
lines changed

5 files changed

+25
-30
lines changed

tests/data/line/hello16.pdl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ text:
2020
- 'Question: Write a JSON object with 2 fields "bob" and "carol" set to "20" and "30" respectively.'
2121
parser: yaml
2222
parameters:
23-
decoding_method: greedy
23+
temperature: 0
2424
stop:
2525
- '}'
2626
include_stop_sequence: true

tests/data/line/hello3.pdl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
description: Hello world to call into a model
22
defs:
3-
model: watsonx/ibm/granite-34b-code-instruct
3+
model: watsonx/ibm/granite-20b-code-instruct
44
text:
55
- Hello,
66
- model: ${ model }
77
spec: int
88
parameters:
9-
decoding_method: greedy
9+
temperature: 0
1010
stop:
1111
- '!'
12-
include_stop_sequence: true
1312
mock_response: " World!"

tests/test_model.py

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
"text": [
77
"Hello,",
88
{
9-
"model": "watsonx/ibm/granite-34b-code-instruct",
9+
"model": "watsonx/meta-llama/llama-3-8b-instruct",
1010
"parameters": {
11-
"decoding_method": "greedy",
12-
"stop_sequences": ["!"],
13-
"include_stop_sequence": False,
11+
"temperature": 0,
12+
"stop": ["!"],
1413
"mock_response": " World",
1514
},
1615
},
@@ -34,9 +33,9 @@ def test_model():
3433
"def": "SOMEONE",
3534
"text": [
3635
{
37-
"model": "watsonx/ibm/granite-34b-code-instruct",
36+
"model": "watsonx/meta-llama/llama-3-8b-instruct",
3837
"parameters": {
39-
"decoding_method": "greedy",
38+
"temperature": 0,
4039
"stop": ["!"],
4140
"include_stop_sequence": False,
4241
"mock_response": " World",
@@ -54,8 +53,8 @@ def test_model():
5453
{
5554
"model": "watsonx/google/flan-t5-xl",
5655
"parameters": {
57-
"decoding_method": "greedy",
58-
"stop_sequences": ["."],
56+
"temperature": 0,
57+
"stop": ["."],
5958
"include_stop_sequence": True,
6059
"roles": {"user": {"pre_message": "", "post_message": ""}},
6160
"mock_response": 'World is a fictional character in the popular science fiction television series "The X-Files',
@@ -85,7 +84,7 @@ def test_model_chain():
8584
"def": "LOCATION",
8685
"text": [
8786
{
88-
"model": "watsonx/ibm/granite-34b-code-instruct",
87+
"model": "watsonx/meta-llama/llama-3-8b-instruct",
8988
"input": {
9089
"text": [
9190
"Question: What is the weather in London?\n",
@@ -98,8 +97,8 @@ def test_model_chain():
9897
]
9998
},
10099
"parameters": {
101-
"decoding_method": "greedy",
102-
"stop_sequences": ["Question"],
100+
"temperature": 0,
101+
"stop": ["Question"],
103102
"include_stop_sequence": False,
104103
"mock_response": "Armonk",
105104
},
@@ -122,9 +121,9 @@ def test_multi_shot():
122121
"text": [
123122
"Hello,\n",
124123
{
125-
"model": "watsonx/ibm/granite-34b-code-instruct",
124+
"model": "watsonx/meta-llama/llama-3-8b-instruct",
126125
"parameters": {
127-
"stop_sequences": ["."],
126+
"stop": ["."],
128127
"mock_response": '\nI have a question about the use of the word "in" in the sentence: "The cake was baked in the oven.',
129128
},
130129
},
@@ -144,12 +143,12 @@ def test_data_missing_parameters():
144143

145144
model_parameter = {
146145
"description": "Hello world with a variable",
147-
"defs": {"model": "watsonx/ibm/granite-34b-code-instruct"},
146+
"defs": {"model": "watsonx/meta-llama/llama-3-8b-instruct"},
148147
"text": [
149148
"Hello,",
150149
{
151150
"model": "${ model }",
152-
"parameters": {"stop_sequences": ["!"], "mock_response": " World!"},
151+
"parameters": {"stop": ["!"], "mock_response": " World!"},
153152
},
154153
],
155154
}
@@ -164,12 +163,12 @@ def test_model_parameter():
164163

165164
model_parameter1 = {
166165
"description": "Hello world with a variable",
167-
"defs": {"model": "granite-34b-code-instruct"},
166+
"defs": {"model": "watsonx/meta-llama/llama-3-8b-instruct"},
168167
"text": [
169168
"Hello,",
170169
{
171170
"model": "watsonx/ibm/${ model }",
172-
"parameters": {"stop_sequences": ["!"], "mock_response": " World!"},
171+
"parameters": {"stop": ["!"], "mock_response": " World!"},
173172
},
174173
],
175174
}
@@ -187,7 +186,7 @@ def test_model_parameter1():
187186
"text": [
188187
"Hello,",
189188
{
190-
"model": "watsonx/ibm/granite-34b-code-instruct-v2",
189+
"model": "watsonx/meta-llama/llama-3-8b-instruct",
191190
"platform": "litellm",
192191
"parameters": {"stop": ["!"], "mock_response": " World!"},
193192
},

tests/test_parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
},
2626
"parser": "json",
2727
"parameters": {
28-
"stop_sequences": ["}"],
29-
"include_stop_sequence": True,
28+
"stop": ["}"],
3029
"mock_response": '{"bob": 20, "carol": 30}',
3130
},
3231
}

tests/test_var.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
{
1919
"model": "watsonx/ibm/granite-34b-code-instruct",
2020
"parameters": {
21-
"decoding_method": "greedy",
22-
"stop_sequences": ["!"],
23-
"include_stop_sequence": False,
21+
"temperature": 0,
22+
"stop": ["!"],
2423
"mock_response": " World",
2524
},
2625
}
@@ -51,9 +50,8 @@ def test_var():
5150
{
5251
"model": "watsonx/ibm/granite-34b-code-instruct",
5352
"parameters": {
54-
"decoding_method": "greedy",
55-
"stop_sequences": ["!"],
56-
"include_stop_sequence": False,
53+
"temperature": 0,
54+
"stop": ["!"],
5755
"mock_response": " World",
5856
},
5957
}

0 commit comments

Comments
 (0)