Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
6336eea4
Unverified
Commit
6336eea4
authored
Nov 05, 2025
by
Nathan Barry
Committed by
GitHub
Nov 06, 2025
Browse files
fix: Remove constant gpt-2 token_id upper bound check (#3760)
Co-authored-by:
Ryan McCormick
<
rmccormick@nvidia.com
>
parent
f7244d1c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
23 deletions
+0
-23
lib/llm/src/protocols/openai/validate.rs
lib/llm/src/protocols/openai/validate.rs
+0
-23
No files found.
lib/llm/src/protocols/openai/validate.rs
View file @
6336eea4
...
@@ -85,8 +85,6 @@ pub const MAX_TOOLS: usize = 128;
...
@@ -85,8 +85,6 @@ pub const MAX_TOOLS: usize = 128;
// Metadata validation constants removed - we are no longer restricting the metadata field char limits
// Metadata validation constants removed - we are no longer restricting the metadata field char limits
/// Maximum allowed length for function names
/// Maximum allowed length for function names
pub
const
MAX_FUNCTION_NAME_LENGTH
:
usize
=
64
;
pub
const
MAX_FUNCTION_NAME_LENGTH
:
usize
=
64
;
/// Maximum allowed value for Prompt IntegerArray elements
pub
const
MAX_PROMPT_TOKEN_ID
:
u32
=
50256
;
/// Minimum allowed value for `repetition_penalty`
/// Minimum allowed value for `repetition_penalty`
pub
const
MIN_REPETITION_PENALTY
:
f32
=
0.0
;
pub
const
MIN_REPETITION_PENALTY
:
f32
=
0.0
;
/// Maximum allowed value for `repetition_penalty`
/// Maximum allowed value for `repetition_penalty`
...
@@ -440,16 +438,6 @@ pub fn validate_prompt(prompt: &dynamo_async_openai::types::Prompt) -> Result<()
...
@@ -440,16 +438,6 @@ pub fn validate_prompt(prompt: &dynamo_async_openai::types::Prompt) -> Result<()
if
arr
.is_empty
()
{
if
arr
.is_empty
()
{
anyhow
::
bail!
(
"Prompt integer array cannot be empty"
);
anyhow
::
bail!
(
"Prompt integer array cannot be empty"
);
}
}
for
(
i
,
&
token_id
)
in
arr
.iter
()
.enumerate
()
{
if
token_id
>
MAX_PROMPT_TOKEN_ID
{
anyhow
::
bail!
(
"Token ID at index {} must be between 0 and {}, got {}"
,
i
,
MAX_PROMPT_TOKEN_ID
,
token_id
);
}
}
}
}
dynamo_async_openai
::
types
::
Prompt
::
ArrayOfIntegerArray
(
arr
)
=>
{
dynamo_async_openai
::
types
::
Prompt
::
ArrayOfIntegerArray
(
arr
)
=>
{
if
arr
.is_empty
()
{
if
arr
.is_empty
()
{
...
@@ -459,17 +447,6 @@ pub fn validate_prompt(prompt: &dynamo_async_openai::types::Prompt) -> Result<()
...
@@ -459,17 +447,6 @@ pub fn validate_prompt(prompt: &dynamo_async_openai::types::Prompt) -> Result<()
if
inner_arr
.is_empty
()
{
if
inner_arr
.is_empty
()
{
anyhow
::
bail!
(
"Prompt integer array at index {} cannot be empty"
,
i
);
anyhow
::
bail!
(
"Prompt integer array at index {} cannot be empty"
,
i
);
}
}
for
(
j
,
&
token_id
)
in
inner_arr
.iter
()
.enumerate
()
{
if
token_id
>
MAX_PROMPT_TOKEN_ID
{
anyhow
::
bail!
(
"Token ID at index [{}][{}] must be between 0 and {}, got {}"
,
i
,
j
,
MAX_PROMPT_TOKEN_ID
,
token_id
);
}
}
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment