[Docs] Lazy import gguf (#20785)

Signed-off-by: simon-mo <simon.mo@hey.com>
This commit is contained in:
Simon Mo
2025-07-10 16:06:37 -07:00
committed by GitHub
parent 5b6fe23d05
commit b854321ffe
2 changed files with 10 additions and 2 deletions
@@ -14,7 +14,6 @@ from pathlib import Path
from typing import Any, Callable, Optional, Union
import filelock
import gguf
import huggingface_hub.constants
import numpy as np
import torch
@@ -40,6 +39,11 @@ except (ImportError, OSError):
SafetensorsStreamer = runai_model_streamer.placeholder_attr(
"SafetensorsStreamer")
try:
import gguf
except ImportError:
gguf = PlaceholderModule("gguf")
try:
from fastsafetensors import SafeTensorsFileLoader, SingleGroup
except ImportError: