BladeSzaSza's picture
fix: define REPO_NAME in hf_upload.sh (ensure_blade_space referenced it)
4948993 verified
Raw
History Blame Contribute Delete
739 Bytes
"""Serving backends for the FormScout judge/classifier VLM."""
from __future__ import annotations
def get_vlm_client():
"""Return the VLM client for the resolved judge backend.
transformers (in-process, ZeroGPU) on a Space; llama-server locally. Falls
back to the llama.cpp client if the transformers backend can't be imported.
"""
from formscout import config
if config.resolve_judge_backend() == "transformers":
try:
from formscout.serving.transformers_vlm import TransformersVLMClient
return TransformersVLMClient()
except Exception:
pass
from formscout.serving.llama_cpp import LlamaCppClient
return LlamaCppClient(port=config.LLAMA_CPP_PORT_VLM)