[test] Added test_align.py and Before change nanovllm attention.
This commit is contained in:
@@ -480,7 +480,7 @@ class ModelRunner:
|
||||
if input_ids.numel() == 0:
|
||||
break
|
||||
|
||||
# Run model forward
|
||||
#> Run model forward
|
||||
logits = self.run_model(input_ids, positions, is_prefill=True)
|
||||
reset_context()
|
||||
|
||||
|
||||
@@ -34,6 +34,14 @@ class Sequence:
|
||||
def __getitem__(self, key):
|
||||
return self.token_ids[key]
|
||||
|
||||
def __repr__(self):
|
||||
ids = self.token_ids
|
||||
if len(ids) > 20:
|
||||
ids_str = "[" + ", ".join(map(str, ids[:10])) + ", ..., " + ", ".join(map(str, ids[-5:])) + "]"
|
||||
else:
|
||||
ids_str = str(ids)
|
||||
return f"Seq(id={self.seq_id}, status={self.status.name}, tokens={self.num_tokens}, ids={ids_str})"
|
||||
|
||||
@property
|
||||
def is_finished(self):
|
||||
return self.status == SequenceStatus.FINISHED
|
||||
|
||||
Reference in New Issue
Block a user