Spaces:
Running
Running
Download app/factory.py from knighter75/llm-proxy: direct link, hf CLI and curl.
- Browser
- Download file 422 Bytes
-
https://huggingface.co/spaces/knighter75/llm-proxy/resolve/main/app/factory.py
- Command line
-
hf download hf://spaces/knighter75/llm-proxy/app/factory.py
-
curl -L -o factory.py https://huggingface.co/spaces/knighter75/llm-proxy/resolve/main/app/factory.py
422 Bytes
| from .providers.hf_openai import HFOpenAIProvider, configured_models | |
| class ProviderFactory: | |
| _instance = None | |
| def get_provider(cls, model_name: str) -> HFOpenAIProvider: | |
| if model_name not in configured_models(): | |
| raise ValueError(f"Unsupported model: {model_name}") | |
| if cls._instance is None: | |
| cls._instance = HFOpenAIProvider() | |
| return cls._instance | |