Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add GGUF model router support across all model types & refactor the code #223

Merged
merged 2 commits into from
Nov 9, 2024

Conversation

qmeng222
Copy link
Collaborator

@qmeng222 qmeng222 commented Nov 7, 2024

No description provided.

…ltimodal, and Audio) in Streamlit & refactor the code
@qmeng222 qmeng222 requested a review from zhiyuan8 November 7, 2024 04:11
Copy link
Contributor

@zhiyuan8 zhiyuan8 left a comment

Choose a reason for hiding this comment

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

Great job! Please fix one minor issue and ready to merge

# get model specific defaults:
default_params = get_default_params(model_to_check)

# adjust step range based on model type:
Copy link
Contributor

@zhiyuan8 zhiyuan8 Nov 8, 2024

Choose a reason for hiding this comment

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

You should read in those parameters from
https://github.com/NexaAI/nexa-sdk/blob/main/nexa/constants.py#L311-L353

use
DEFAULT_IMG_GEN_PARAMS_LCM.num_inference_steps

Copy link
Collaborator Author

@qmeng222 qmeng222 Nov 8, 2024

Choose a reason for hiding this comment

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

@zhiyuan8 Let me clarify the get_default_params() approach:
Different computer vision models require their own default parameters. More specifically,

  • LCM models → DEFAULT_IMG_GEN_PARAMS_LCM (4 steps, 1.0 guidance)
  • SDXL-turbo → DEFAULT_IMG_GEN_PARAMS_TURBO (5 steps, 5.0 guidance)
  • Standard SD models → DEFAULT_IMG_GEN_PARAMS (20 steps, 7.5 guidance)

The get_default_params function at https://github.com/NexaAI/nexa-sdk/blob/qingying-model-router-streamlit/nexa/gguf/streamlit/streamlit_image_chat.py#L23-L30 picks the right parameter set based on model name(type). Happy to add clearer documentation, or let me know if I didn't get your point.

@qmeng222 qmeng222 requested a review from zhiyuan8 November 8, 2024 23:12
@zhiyuan8 zhiyuan8 merged commit 568107f into main Nov 9, 2024
2 checks passed
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.

2 participants