Skip to content

Conversation

@marchuk-vlad
Copy link
Collaborator

@marchuk-vlad marchuk-vlad commented Jun 20, 2025

Summary by CodeRabbit

  • Chores
    • Updated the way Python requirements files are processed during Docker build, improving compatibility with requirements located in subdirectories. No changes to app features or user interface.

@marchuk-vlad marchuk-vlad requested a review from Idris0v June 20, 2025 13:01
@marchuk-vlad marchuk-vlad self-assigned this Jun 20, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 20, 2025

Walkthrough

The Dockerfile was updated to modify how Python requirements files are located and edited. The search for requirements files now targets the requirements subdirectory within text-generation-webui up to two directory levels deep, instead of searching only the top level. The subsequent file modifications remain unchanged.

Changes

File(s) Change Summary
Text Generation WebUI/Dockerfile Updated the find command to search for requirements files in a subdirectory with increased depth; file edits unchanged.

Poem

In the warren of code, I hop with delight,
Searching requirements, now deeper in sight.
From top-level to subfolders, I burrow anew,
Two levels I wander, with packages in view.
🐇 Docker’s my meadow, dependencies my hay—
The build hops along, in a more thorough way!


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a915b29 and 35d94cb.

📒 Files selected for processing (1)
  • Text Generation WebUI/Dockerfile (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • Text Generation WebUI/Dockerfile
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (javascript-typescript)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3d6ba62 and d7c5de4.

📒 Files selected for processing (2)
  • Text Generation WebUI/Dockerfile (1 hunks)
  • Text Generation WebUI/text-generation-webui (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
🔇 Additional comments (1)
Text Generation WebUI/text-generation-webui (1)

1-1: Verify updated subproject commit exists
Ensure the new commit 17f9c188bdb409740b51a4061ba527cf1345c4db is present in the upstream repo and that CI can fetch it successfully.

#!/bin/bash
# Verify that the specified commit exists in the remote repository
git ls-remote https://github.com/oobabooga/text-generation-webui.git | grep 17f9c188bdb409740b51a4061ba527cf1345c4db

Comment on lines +26 to +27
find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" -exec sed -i 's/transformers==/transformers[torch,flax,timm,sentencepiece,onnx,ftfy,tokenizers]==/g' {} \; &&\
find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" -exec sh -c 'echo "\nsacremoses\noptimum\nauto-gptq\nautoawq\nbitsandbytes" >> {}' \; &&\
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix newline insertion and optimize find -exec usage
The current echo "\n…" invocation won’t interpret \n as newlines in POSIX shells, so literal \n will be appended. Also, spawning a separate sed process per file can be slow.

Apply this diff to correctly insert newlines and batch the sed calls:

-    find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" -exec sed -i 's/transformers==/transformers[torch,flax,timm,sentencepiece,onnx,ftfy,tokenizers]==/g' {} \; &&\
-    find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" -exec sh -c 'echo "\nsacremoses\noptimum\nauto-gptq\nautoawq\nbitsandbytes" >> {}' \; &&\
+    # Batch-edit all matching files in one go, then append new lines correctly via printf
+    find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" \
+      -exec sed -i 's/transformers==/transformers[torch,flax,timm,sentencepiece,onnx,ftfy,tokenizers]==/g' {} + &&\
+    find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" \
+      -exec sh -c 'printf "\n%s\n" sacremoses optimum auto-gptq autoawq bitsandbytes >> "$1"' _ {} + &&\
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" -exec sed -i 's/transformers==/transformers[torch,flax,timm,sentencepiece,onnx,ftfy,tokenizers]==/g' {} \; &&\
find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" -exec sh -c 'echo "\nsacremoses\noptimum\nauto-gptq\nautoawq\nbitsandbytes" >> {}' \; &&\
# Batch-edit all matching files in one go, then append new lines correctly via printf
find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" \
-exec sed -i 's/transformers==/transformers[torch,flax,timm,sentencepiece,onnx,ftfy,tokenizers]==/g' {} + &&\
find ./text-generation-webui/requirements -maxdepth 2 -type f -name "requirements*" \
-exec sh -c 'printf "\n%s\n" sacremoses optimum auto-gptq autoawq bitsandbytes >> "$1"' _ {} + &&\
🤖 Prompt for AI Agents
In Text Generation WebUI/Dockerfile at lines 26-27, the echo command appends a
literal "\n" instead of a newline, and the sed command runs separately for each
file, which is inefficient. Fix this by replacing the echo command with printf
to correctly insert newlines, and optimize the sed command to process multiple
files in a single invocation or use xargs to batch the calls, reducing the
number of spawned processes.

@marchuk-vlad marchuk-vlad changed the title feat(TGWUI): Update v3.6.1 fix(TGWUI): Modify requiremets.txt in correct directories Jun 20, 2025
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