-
Notifications
You must be signed in to change notification settings - Fork 20
fix(TGWUI): Modify requiremets.txt in correct directories #114
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
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe Dockerfile was updated to modify how Python requirements files are located and edited. The search for requirements files now targets the Changes
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
📒 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 commit17f9c188bdb409740b51a4061ba527cf1345c4dbis 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
| 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" >> {}' \; &&\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
| 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.
a915b29 to
35d94cb
Compare
Summary by CodeRabbit