Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix and add test #721

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 27 additions & 1 deletion integration-tests/test_classifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,33 @@ def test_distilbert_ner():
with run_lorax_container(config):
response = requests.post(
"http://localhost:8080/classify",
json={"inputs": "Johnny supports the Golden State Warriors. He lives in London."},
json={
"inputs": "Johnny supports the Golden State Warriors. He lives in London."
},
)
response.raise_for_status()
print("RESPONSE FROM CLASSIFICATION:", response.json())
assert len(response.json()) > 0


def test_bert_ner():
config = {
"name": "bert-ner",
"model_id": "dslim/bert-base-NER",
"docker_args": {
"max_input_length": 512,
"max_batch_prefill_tokens": 512,
"max_batch_total_tokens": 512,
"max_total_tokens": 512,
"backend": "flashinfer",
},
}
with run_lorax_container(config):
response = requests.post(
"http://localhost:8080/classify",
json={
"inputs": "Johnny supports the Golden State Warriors. He lives in London."
},
)
response.raise_for_status()
print("RESPONSE FROM CLASSIFICATION:", response.json())
Expand Down
2 changes: 2 additions & 0 deletions server/lorax_server/models/flash_bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,8 @@ def _forward_context(
num_heads=self.num_heads,
num_kv_heads=self.num_kv_heads,
head_size=self.head_size,
# TODO: This is a hack to get the prefill state to work
window_left=0,
)

def forward(self, batch: FlashEmbeddingClassificationBatch):
Expand Down
Loading