Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions extension/llm/export/config/llm_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"""

import argparse
import ast
import re
from dataclasses import dataclass, field
from enum import Enum
Expand Down Expand Up @@ -166,7 +165,6 @@ class ModelConfig:

def __post_init__(self):
self._validate_attention_sink()
self._validate_local_global_attention()

if self.quantize_kv_cache and not self.use_kv_cache:
raise ValueError(
Expand All @@ -186,18 +184,6 @@ def _validate_attention_sink(self):
"The value of use_attention_sink must be structured like '<sink_size>,<window_size>,<batch_eviction_size>'"
)

def _validate_local_global_attention(self):
if self.local_global_attention:
local_global_err = "The value of local_global_attention must be a list of integers, e.g., [0, 16, 0, 16]"
try:
parsed = ast.literal_eval(self.local_global_attention)
if not (
isinstance(parsed, list) and all(isinstance(i, int) for i in parsed)
):
raise ValueError(local_global_err)
except Exception:
raise ValueError(local_global_err)


################################################################################
################################ ExportConfig ##################################
Expand Down
Loading