Suppress token usage warnings for custom OpenAI-compatible endpoints
• Add warning filter for token usage • Support vLLM, SGLang endpoints • Non-critical for RAGAS evaluation
This commit is contained in:
parent
451257aed5
commit
994a82dc7f
1 changed files with 9 additions and 0 deletions
|
|
@ -62,6 +62,15 @@ warnings.filterwarnings(
|
||||||
category=DeprecationWarning,
|
category=DeprecationWarning,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Suppress token usage warning for custom OpenAI-compatible endpoints
|
||||||
|
# Custom endpoints (vLLM, SGLang, etc.) often don't return usage information
|
||||||
|
# This is non-critical as token tracking is not required for RAGAS evaluation
|
||||||
|
warnings.filterwarnings(
|
||||||
|
"ignore",
|
||||||
|
message=".*Unexpected type for token usage.*",
|
||||||
|
category=UserWarning,
|
||||||
|
)
|
||||||
|
|
||||||
# Add parent directory to path
|
# Add parent directory to path
|
||||||
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
sys.path.insert(0, str(Path(__file__).parent.parent.parent))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue