huangyz0918 / termax

Termax: an open-sourced implementation of Github Copilot CLI, with command suggestion, explanation, and power by LLMs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dynamic load LLM python framework

huangyz0918 opened this issue · comments

Check if the package has been installed or not, if yes then import, if not, give an warning and return.

Reference code:

wandb_spec = importlib.util.find_spec("wandb")
if wandb_spec is not None:
    import wandb
else:
    warnings.warn(
        "It seems you didn't install wandb. In order to enable the Weights & Biases related features, "
        "please make sure wandb Python package has been installed. "
        "More information, please refer to: https://docs.wandb.ai/quickstart"
    )