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
4 changes: 2 additions & 2 deletions nemo_skills/inference/model/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ async def generate_async(
top_k: int = -1,
min_p: float = 0.0,
repetition_penalty: float = 1.0,
random_seed: int = 0,
random_seed: int = None,
stop_phrases: list[str] | None = None,
top_logprobs: int | None = None,
timeout: float | int | None = 10000, # None is 10min
Expand Down Expand Up @@ -183,7 +183,7 @@ def generate_sync(
top_k: int = -1,
min_p: float = 0.0,
repetition_penalty: float = 1.0,
random_seed: int = 0,
random_seed: int = None,
stop_phrases: list[str] | None = None,
top_logprobs: int | None = None,
timeout: float | int | None = 10000, # None is 10min
Expand Down
2 changes: 1 addition & 1 deletion nemo_skills/inference/model/megatron.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _build_completion_request_params(
top_k: int = -1,
min_p: float = 0.0,
repetition_penalty: float = 1.0,
random_seed: int = 0,
random_seed: int = None,
stop_phrases: list[str] | None = None,
timeout: int | None = None,
top_logprobs: int | None = None,
Expand Down
8 changes: 6 additions & 2 deletions nemo_skills/inference/model/vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _build_completion_request_params(
top_k: int = -1,
min_p: float = 0.0,
repetition_penalty: float = 1.0,
random_seed: int = 0,
random_seed: int = None,
top_logprobs: int | None = None,
timeout: int | None = None,
stop_phrases: list[str] | None = None,
Expand All @@ -64,6 +64,8 @@ def _build_completion_request_params(
extra_body: dict = None,
tools: list[dict] | None = None,
) -> dict:
assert reasoning_effort is None, "reasoning_effort is not supported for text completion requests"
assert tools is None, "tools are not supported for text completion requests"
return {
"prompt": prompt,
"max_tokens": tokens_to_generate,
Expand Down Expand Up @@ -117,6 +119,8 @@ def _build_chat_request_params(
"extra_body": self._build_request_body(top_k, min_p, repetition_penalty, extra_body=extra_body),
"tools": tools,
}
if reasoning_effort:
request["allowed_openai_params"] = ["reasoning_effort"]
request["reasoning_effort"] = reasoning_effort
return request