Skip to content

Commit

Permalink
Ignoring unmatched config var names
Browse files Browse the repository at this point in the history
  • Loading branch information
saeeddhqan committed Nov 25, 2024
1 parent c1cb468 commit 3cfdefb
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions ultravox/model/ultravox_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ def test_can_load_release(model_id: str):
config_from_dict = ultravox_config.UltravoxConfig(**orig_config.to_dict())
config_from_diff_dict = ultravox_config.UltravoxConfig(**orig_config.to_diff_dict())
keys_to_ignore = ("audio_latency_block_size",)
orig_values = {
**{k: None for k in keys_to_ignore},
**orig_config.to_dict(),
}

assert (
exclude_key(config_from_dict.to_dict(), keys_to_ignore) == orig_config.to_dict()
)
assert (
exclude_key(config_from_diff_dict.to_dict(), keys_to_ignore)
== orig_config.to_dict()
)
assert config_from_dict.to_dict() == orig_values
assert config_from_diff_dict.to_dict() == orig_values

assert config_from_dict.text_config.to_dict() == orig_config.text_config.to_dict()
assert config_from_dict.audio_config.to_dict() == orig_config.audio_config.to_dict()
Expand All @@ -38,13 +37,8 @@ def test_can_load_release(model_id: str):
config_reloaded_diff = ultravox_config.UltravoxConfig(
**config_from_dict.to_diff_dict()
)
assert (
config_reloaded.to_dict() == {**{k: None for k in keys_to_ignore}, **orig_config.to_dict()}
)
assert (
exclude_key(config_reloaded_diff.to_dict(), keys_to_ignore)
== orig_config.to_dict()
)
assert config_reloaded.to_dict() == orig_values
assert config_reloaded_diff.to_dict() == orig_values


def test_no_config_when_id_present():
Expand Down

0 comments on commit 3cfdefb

Please sign in to comment.