Skip to content

Commit

Permalink
Make debugging easier
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <[email protected]>
  • Loading branch information
DarkLight1337 committed Nov 25, 2024
1 parent 6b448f8 commit 21df44f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
4 changes: 2 additions & 2 deletions tests/models/embedding/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def check_embeddings_close(
dim=0)

fail_msg = (f"Test{prompt_idx}:"
f"\n{name_0}:\t{embeddings_0!r}"
f"\n{name_1}:\t{embeddings_1!r}")
f"\n{name_0}:\t{embeddings_0[:16]!r}"
f"\n{name_1}:\t{embeddings_1[:16]!r}")

assert sim >= 1 - tol, fail_msg
15 changes: 11 additions & 4 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
get_hf_text_config, get_pooling_config,
get_sentence_transformer_tokenizer_config, is_encoder_decoder, uses_mrope)
from vllm.utils import (GiB_bytes, cuda_device_count_stateless, get_cpu_memory,
identity, print_warning_once, resolve_obj_by_qualname)
print_warning_once, resolve_obj_by_qualname)

if TYPE_CHECKING:
from ray.util.placement_group import PlacementGroup
Expand Down Expand Up @@ -182,7 +182,7 @@ def __init__(
hf_overrides_fn = hf_overrides
else:
hf_overrides_kw = hf_overrides
hf_overrides_fn = identity
hf_overrides_fn = None

if rope_scaling is not None:
hf_override: Dict[str, Any] = {"rope_scaling": rope_scaling}
Expand Down Expand Up @@ -211,8 +211,15 @@ def __init__(
self.skip_tokenizer_init = skip_tokenizer_init

hf_config = get_config(self.model, trust_remote_code, revision,
code_revision, config_format, **hf_overrides_kw)
hf_config = hf_overrides_fn(hf_config)
code_revision, config_format)

if hf_overrides_kw:
logger.info("Overriding HF config with %s", hf_overrides_kw)
hf_config.update(hf_overrides_kw)
if hf_overrides_fn:
logger.info("Overriding HF config with %s", hf_overrides_fn)
hf_config = hf_overrides_fn(hf_config)

self.hf_config = hf_config

self.hf_text_config = get_hf_text_config(self.hf_config)
Expand Down

0 comments on commit 21df44f

Please sign in to comment.