Skip to content

DeepInfer: High-performance, large-scale inference framework for DeepSeek models

Python
288 B
Raw Blame
import importlib.util


def load_class_from_file(file_path: str, class_name: str) -> type:
    spec = importlib.util.spec_from_file_location("module", file_path)
    module = importlib.util.module_from_spec(spec)
    spec.loader.exec_module(module)
    return getattr(module, class_name)