Skip to content

add model to self-hosted mode#162

Merged
JaredforReal merged 1 commit intomainfrom
model
Mar 24, 2026
Merged

add model to self-hosted mode#162
JaredforReal merged 1 commit intomainfrom
model

Conversation

@JaredforReal
Copy link
Copy Markdown
Collaborator

@JaredforReal JaredforReal commented Mar 24, 2026

Fix: #159

Contribution Guide

We welcome your contributions to this repository. To ensure elegant code style and better code quality, we have prepared
the following contribution guidelines.

What We Accept

  • This PR fixes a typo or improves the documentation (if this is the case, you may skip the other checks).
  • This PR fixes a specific issue — please reference the issue number in the PR description. Make sure your code strictly
    follows the coding standards below.
  • This PR introduces a new feature — please clearly explain the necessity and implementation of the feature. Make sure
    your code strictly follows the coding standards below.

Code Style Guide

Good code style is an art. We have prepared a pre-commit hook to enforce consistent code
formatting across the project. You can clean up your code following the steps below:

pre-commit run --all-files

If your code complies with the standards, you should not see any errors.

Naming Conventions

  • Please use English for naming; do not use Pinyin or other languages. All comments should also be in English.
  • Follow PEP8 naming conventions strictly, and use underscores to separate words. Avoid meaningless names such as
    a, b, c.

Signed-off-by: JaredforReal <w13431838023@gmail.com>
Copilot AI review requested due to automatic review settings March 24, 2026 09:02
@JaredforReal JaredforReal merged commit 10d3fab into main Mar 24, 2026
4 checks passed
Copy link
Copy Markdown
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

Adds support for passing a model via the top-level GlmOcr(..., model=...) constructor when running in self-hosted mode, ensuring it reaches the self-hosted OCR API config.

Changes:

  • Forward model constructor override to pipeline.ocr_api.model (in addition to pipeline.maas.model).
  • Add a unit test asserting GlmOcr(mode="selfhosted", model=...) propagates to config_model.pipeline.ocr_api.model.

Reviewed changes

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

File Description
glmocr/config.py Updates GlmOcrConfig.from_env() to apply model override to both MaaS and self-hosted OCR API config paths.
glmocr/tests/test_unit.py Adds a unit test covering model forwarding behavior for self-hosted mode.

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

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.

the model name of glmocr package in selfhosted always default

2 participants