Skip to content

Conversation

@jayvenn21
Copy link
Contributor

@jayvenn21 jayvenn21 commented Feb 6, 2026

Summary by CodeRabbit

  • Refactor
    • Streamlined internal UI configuration management by consolidating control settings and centralizing configuration logic, improving code maintainability while preserving existing functionality.

…ce mode

- Extract get_ui_control_config(is_turbo) as shared config source
- Refactor get_model_type_ui_settings to use get_ui_control_config
- Apply same control config when building UI in service mode (pre-initialized)
- Ensures max steps, CFG/ADG visibility, task types match actual model (Closes ace-step#200)
@ChuxiJ ChuxiJ requested a review from Copilot February 6, 2026 04:57
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes UI control initialization for SFT (non-turbo) models in service mode by extracting a shared configuration function. Previously, the UI was initialized with turbo defaults even when an SFT model was loaded, causing mismatched controls (wrong step limits, hidden CFG/ADG options, incorrect task types).

Changes:

  • Extract get_ui_control_config(is_turbo) to provide a single source of truth for UI control configuration
  • Refactor get_model_type_ui_settings to use the new shared config function
  • Apply correct control configuration during UI initialization when service is pre-initialized with a model

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
acestep/gradio_ui/events/generation_handlers.py Extracts get_ui_control_config() function and refactors get_model_type_ui_settings() to use it
acestep/gradio_ui/interfaces/generation.py Uses get_ui_control_config() to initialize UI controls correctly based on actual model type when service is pre-initialized

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Changes centralize UI control configuration by introducing a new get_ui_control_config() function that returns a dictionary of settings, replacing hardcoded turbo/base branching. This unified configuration is applied by both service and interactive initialization paths to ensure consistent UI parameter setup.

Changes

Cohort / File(s) Summary
Configuration Centralization
acestep/gradio_ui/events/generation_handlers.py
Introduces get_ui_control_config(is_turbo: bool) -> dict to consolidate UI control configuration (inference steps, visibility flags, shift, task choices). Updates get_model_type_ui_settings() to wrap the config dict into gr.update tuples, eliminating per-field hardcoded branches.
UI Integration
acestep/gradio_ui/interfaces/generation.py
Imports get_ui_control_config and replaces hardcoded turbo/base branching for initial task choices, inference steps, and visibility flags with backend-driven values. Uses _ui_config to dynamically configure advanced settings and parameter handling for pre-initialized service mode.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Configuration once scattered like clover,
Now bundled in functions, the chaos is over!
Turbo and base models both get their due,
UI controls dancing—configured anew! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Comment @coderabbitai help to get the list of available commands and usage tips.

@ChuxiJ ChuxiJ merged commit b788422 into ace-step:main Feb 11, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gradio app controls are not initialized properly for SFT model in service mode

2 participants