Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class WenxinLLMModelParams(BaseForm):
_step=0.01,
precision=2)

max_tokens = forms.SliderField(
max_output_tokens = forms.SliderField(
TooltipLabel(_('Output the maximum Tokens'),
_('Specify the maximum number of tokens that the model can generate')),
required=True, default_value=1024,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The proposed change from max_tokens to max_output_tokens is valid and aligns with the current naming conventions in many APIs, which often use "output" at the end of parameter names to indicate they refer to what an API generates rather than receiving. This makes sense given the context of LLM (Language Model) parameters, especially since models typically output tokens or sentences.

Potential Improvements:

  1. Documentation Clarity: Consider adding more detailed documentation for both fields (max_output_tokens and potentially _step, precision) about their intended usage and expected values. This will help users better understand how these parameters affect the behavior of your application.

  2. Validation: Ensure that the validation logic remains appropriate for both fields:

    • For max_output_tokens, set a reasonable upper limit based on typical text generation tasks.
    • Validate _step to ensure it meets expectations (e.g., non-negative numbers).
    • Validate precision similarly, ensuring it's within acceptable bounds.
  3. Consistent Naming: If there are other slider fields involving token limits (like max_input_tokens), ensure consistent naming across all similar fields to maintain clarity and ease of use.

Overall, this refactoring appears to be well-intentioned and should work correctly as long as the existing codebase and business requirements are adhered to.

Expand Down