Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pskiran1 committed Sep 30, 2024
1 parent 2e6e1e2 commit 229e5e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
21 changes: 6 additions & 15 deletions qa/L0_http/generate_endpoint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,7 @@ def test_generate(self):

def test_generate_with_all_inputs(self):
# Setup text-based input
text = "hello world"
inputs = {"PROMPT": text, "STREAM": False, "input_ids": [100, 200]}
inputs = {"PROMPT": ["hello", "world"], "STREAM": False}

r = self.generate(self._model_name, inputs)
r.raise_for_status()
Expand All @@ -155,7 +154,7 @@ def test_generate_with_all_inputs(self):

data = r.json()
self.assertIn("TEXT", data)
self.assertEqual(text, data["TEXT"])
self.assertEqual(["hello", "world"], data["TEXT"])

def test_request_id(self):
# Setup text based input
Expand Down Expand Up @@ -235,26 +234,18 @@ def test_missing_inputs(self):
]
for inputs in missing_all_inputs:
self.generate_expect_failure(
self._model_name,
inputs,
"expected number of inputs between 2 and 3 but got 0",
self._model_name, inputs, "expected 2 inputs but got 0"
)
self.generate_stream_expect_failure(
self._model_name,
inputs,
"expected number of inputs between 2 and 3 but got 0",
self._model_name, inputs, "expected 2 inputs but got 0"
)

for inputs in missing_one_input:
self.generate_expect_failure(
self._model_name,
inputs,
"expected number of inputs between 2 and 3 but got 1",
self._model_name, inputs, "expected 2 inputs but got 1"
)
self.generate_stream_expect_failure(
self._model_name,
inputs,
"expected number of inputs between 2 and 3 but got 1",
self._model_name, inputs, "expected 2 inputs but got 1"
)

def test_invalid_input_types(self):
Expand Down
8 changes: 1 addition & 7 deletions qa/L0_http/generate_models/mock_llm/config.pbtxt
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,12 @@ input [
{
name: "PROMPT"
data_type: TYPE_STRING
dims: [ 1, 1 ]
dims: [ 1, -1 ]
},
{
name: "STREAM"
data_type: TYPE_BOOL
dims: [ 1, 1 ]
},
{
name: "input_ids"
data_type: TYPE_INT32
dims: [ 1, -1 ]
optional: true
}
]

Expand Down

0 comments on commit 229e5e8

Please sign in to comment.