Skip to content

Commit

Permalink
Remove _attn_implementation_autoset if present in config.json (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
farzadab authored Feb 6, 2025
1 parent 7e8ea5e commit bcd42c8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ultravox/model/ultravox_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,12 @@ def to_diff_dict(self) -> Dict[str, Any]:
# remove text_config and audio_config if text_model_id and audio_model_id are present
if self.text_model_id is not None:
diff_dict.pop("text_config", None)
elif "text_config" in diff_dict:
diff_dict["text_config"].pop("_attn_implementation_autoset", None)

if self.audio_model_id is not None:
diff_dict.pop("audio_config", None)
elif "audio_config" in diff_dict:
diff_dict["audio_config"].pop("_attn_implementation_autoset", None)

return diff_dict
2 changes: 2 additions & 0 deletions ultravox/ultravoxls/ultravoxls_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,7 @@ def to_diff_dict(self) -> Dict[str, Any]:
# remove text_config if text_model_id
if self.text_model_id is not None:
diff_dict.pop("text_config", None)
elif "text_config" in diff_dict:
diff_dict["text_config"].pop("_attn_implementation_autoset", None)

return diff_dict

0 comments on commit bcd42c8

Please sign in to comment.