fix type annotation for ALL_ATTENTION_FUNCTIONS (#36690)

Corrects the type annotation to match actual usage. The variable was typed as
Dict[str, Dict[str, Callable]] but is actually used as Dict[str, Callable]
where keys are attention mechanism names and values are the corresponding
attention functions directly. This change makes the type annotation consistent
with how the dictionary is used in the codebase.
This commit is contained in:
wineandchord
2025-03-13 22:27:50 +08:00
committed by GitHub
parent 1c287aecfc
commit bb965d8e87

View File

@@ -5835,7 +5835,7 @@ def get_disk_only_shard_files(device_map, weight_map):
return [fname for fname, devices in files_content.items() if set(devices) == {"disk"}]
ALL_ATTENTION_FUNCTIONS: Dict[str, Dict[str, Callable]] = {}
ALL_ATTENTION_FUNCTIONS: Dict[str, Callable] = {}
ALL_ATTENTION_FUNCTIONS.update(
{