Skip to content

Conversation

@Jintao-Huang
Copy link
Collaborator

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Jintao-Huang, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request primarily focuses on enhancing the examples and documentation for the DeepSeek-OCR model. It introduces a dedicated Python script to showcase inference capabilities, updates an existing best practices guide by adjusting a debug setting, and refactors the naming and location of a DeepSeek-OCR training script for better organization and clarity.

Highlights

  • DeepSeek-OCR Inference Example Added: A new Python script (infer.py) has been introduced to demonstrate how to perform inference with the DeepSeek-OCR model using swift.llm.PtEngine, showcasing both standard and streaming output modes.
  • Documentation Update for Debugging: The Qwen3-VL最佳实践.md documentation was updated to comment out the SWIFT_DEBUG environment variable setting, indicating that debug mode is not typically required for the presented inference examples.
  • DeepSeek-OCR Script Reorganization: A shell script related to DeepSeek-OCR was renamed from deepseek_vl2/deepseek_ocr.sh to deepseek_ocr/train.sh, which clarifies its purpose and improves the organization of example files for the DeepSeek-OCR model.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds documentation and example scripts for using the DeepSeek-OCR model. The changes include a new inference script, a new training script, and a minor update to an existing documentation file. My review focuses on improving the clarity and completeness of the new example scripts. I've suggested adding a missing dependency to the installation instructions in infer.py and printing an unused result to make the script more demonstrative. Note that the training script examples/models/deepseek_ocr/train.sh is also missing the easydict dependency in its installation command.

@@ -0,0 +1,29 @@
# pip install "transformers==4.46.3"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The deepseek-ocr model also requires the easydict package, as specified in its model registration. It would be good to include it in the installation instructions to ensure the example runs smoothly for users.

Suggested change
# pip install "transformers==4.46.3"
# pip install "transformers==4.46.3" "easydict"

'role': 'user',
# or
'content': '<image>Free OCR.',
# "content": '<image><|grounding|>Convert the document to markdown.',
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The result from the non-streaming inference is stored in the response variable but is never printed. It would be helpful to print it to demonstrate the output of this inference mode, similar to how the streaming result is handled.

Suggested change
# "content": '<image><|grounding|>Convert the document to markdown.',
response = resp_list[0].choices[0].message.content
print('Non-streaming response:')
print(response)

@Jintao-Huang Jintao-Huang merged commit 76d9f59 into modelscope:main Oct 21, 2025
1 of 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.

1 participant