Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions resources_servers/ifbench/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
import logging
from typing import List, Literal

# Pre-import packages that nltk pulls in during its init so they are already in
# sys.modules before nltk's inisec.py finder is installed. nltk>=3.9 blocks any
# import originating from nltk if the module path falls inside the process CWD —
# which happens in CI where the server venv lives inside the repo root.
import defusedxml.ElementTree # noqa: F401
import regex # noqa: F401
from fastapi import FastAPI

from nemo_gym.base_resources_server import (
Expand Down
7 changes: 7 additions & 0 deletions resources_servers/ifbench/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Pre-import packages that nltk pulls in during its init so they are already in
# sys.modules before nltk's inisec.py finder is installed. This must happen here
# (before ensure_ifbench() calls _ensure_nltk_data() → import nltk) so that the
# punkt download inside _ensure_nltk_data() is not silently blocked.
import defusedxml.ElementTree # noqa: F401
import regex # noqa: F401

from resources_servers.ifbench.setup_ifbench import ensure_ifbench


Expand Down
6 changes: 6 additions & 0 deletions resources_servers/iheval/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
from pathlib import Path
from typing import Any, Dict, List, Literal, Optional, Tuple

# Pre-import packages that nltk pulls in during its init so they are already in
# sys.modules before nltk's inisec.py finder is installed. nltk>=3.9 blocks any
# import originating from nltk if the module path falls inside the process CWD —
# which happens in CI where the server venv lives inside the repo root.
import defusedxml.ElementTree # noqa: F401
import regex # noqa: F401
from fastapi import FastAPI
from pydantic import ConfigDict

Expand Down
2 changes: 1 addition & 1 deletion resources_servers/iheval/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ rouge-score>=0.1.2
# Rule-following: vendored IFEval checkers (ifeval/) depend on these.
immutabledict>=2.0
langdetect>=1.0.9
nltk>=3.9
nltk>=3.10.0
6 changes: 6 additions & 0 deletions resources_servers/instruction_following/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
# limitations under the License.
from typing import Any, Dict, List

# Pre-import packages that nltk pulls in during its init so they are already in
# sys.modules before nltk's inisec.py finder is installed. nltk>=3.9 blocks any
# import originating from nltk if the module path falls inside the process CWD —
# which happens in CI where the server venv lives inside the repo root.
import defusedxml.ElementTree # noqa: F401
import regex # noqa: F401
from fastapi import FastAPI
from pydantic import model_validator
from verifiable_instructions import instructions_registry
Expand Down
6 changes: 6 additions & 0 deletions resources_servers/rolemrc/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@
from functools import lru_cache
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple

# Pre-import packages that nltk pulls in during its init so they are already in
# sys.modules before nltk's inisec.py finder is installed. nltk>=3.9 blocks any
# import originating from nltk if the module path falls inside the process CWD —
# which happens in CI where the server venv lives inside the repo root.
import defusedxml.ElementTree # noqa: F401
import regex # noqa: F401
from fastapi import FastAPI
from pydantic import ConfigDict, PrivateAttr

Expand Down
2 changes: 1 addition & 1 deletion resources_servers/rolemrc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Reference-metric scoring (reference mode).
rouge-score>=0.1.2
sacrebleu>=2.4
nltk>=3.9
nltk>=3.10.0
# BERTScore is on by default in reference mode; pulls a roberta-large checkpoint
# on first use. Drop these three deps (and set include_bertscore=false) for a
# lightweight ROUGE/BLEU/METEOR-only install. matplotlib + pillow are declared
Expand Down
6 changes: 6 additions & 0 deletions resources_servers/toolsandbox/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@
import uuid
from typing import Any, Dict, List, Optional, Tuple

# Pre-import packages that nltk pulls in during its init so they are already in
# sys.modules before nltk's inisec.py finder is installed. nltk>=3.9 blocks any
# import originating from nltk if the module path falls inside the process CWD —
# which happens in CI where the server venv lives inside the repo root.
import defusedxml.ElementTree # noqa: F401
import polars as pl
import regex # noqa: F401
from fastapi import FastAPI, Request
from openai import NOT_GIVEN
from openai.types.chat import ChatCompletion
Expand Down
Loading