mbochniak01 Claude Sonnet 4.6 commited on
Commit ·
cbb4147
1
Parent(s): eb90c62
Add trust_remote_code=True for Vectara hallucination model
Browse filesVectara model uses custom code — required flag for both the Dockerfile
pre-download step and the CrossEncoder constructor in grader.py.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Dockerfile +1 -1
- backend/grader.py +1 -1
Dockerfile
CHANGED
|
@@ -12,7 +12,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 12 |
|
| 13 |
# Pre-download models so first request isn't slow on HF Spaces
|
| 14 |
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
|
| 15 |
-
RUN python -c "from sentence_transformers import CrossEncoder; CrossEncoder('vectara/hallucination_evaluation_model')"
|
| 16 |
|
| 17 |
COPY knowledge/ ./knowledge/
|
| 18 |
COPY backend/ ./backend/
|
|
|
|
| 12 |
|
| 13 |
# Pre-download models so first request isn't slow on HF Spaces
|
| 14 |
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
|
| 15 |
+
RUN python -c "from sentence_transformers import CrossEncoder; CrossEncoder('vectara/hallucination_evaluation_model', trust_remote_code=True)"
|
| 16 |
|
| 17 |
COPY knowledge/ ./knowledge/
|
| 18 |
COPY backend/ ./backend/
|
backend/grader.py
CHANGED
|
@@ -39,7 +39,7 @@ def get_nli_model() -> CrossEncoder:
|
|
| 39 |
"""Return the shared NLI cross-encoder, loading it on first call."""
|
| 40 |
global _nli_model
|
| 41 |
if _nli_model is None:
|
| 42 |
-
_nli_model = CrossEncoder(NLI_MODEL)
|
| 43 |
return _nli_model
|
| 44 |
|
| 45 |
|
|
|
|
| 39 |
"""Return the shared NLI cross-encoder, loading it on first call."""
|
| 40 |
global _nli_model
|
| 41 |
if _nli_model is None:
|
| 42 |
+
_nli_model = CrossEncoder(NLI_MODEL, trust_remote_code=True)
|
| 43 |
return _nli_model
|
| 44 |
|
| 45 |
|