-
Notifications
You must be signed in to change notification settings - Fork 0
Simplify remote training and improve documentation #9
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- Remove problematic eval statement that caused syntax errors - Replace bash array with simple space-separated list in loop - Use temporary file and line-by-line parsing instead of eval - Fixes: './sync_models.sh: eval: line 100: syntax error near unexpected token' The issue was that bash arrays in the heredoc were causing problems when eval'd. Now uses a simpler approach that's more portable.
remote_train.sh: - Fixed 'command not found' error by reorganizing SSH execution - Moved SSH command with heredoc to proper location - Removed duplicate SSH execution that caused issues - Fixed variable escaping in screen command sync_models.sh: - Fixed syntax error with bash arrays in eval statement - Replaced eval with safer line-by-line parsing - Use simple loops instead of bash arrays for portability Both scripts now properly execute on remote servers without syntax errors.
- Added menu to choose authentication method (SSH, token, or skip) - Support GitHub Personal Access Tokens for private repo access - Automatically detect and use SSH if keys are configured - Option to skip repo update and use existing code - Configure Git credential caching to avoid repeated prompts - Pass credentials securely through SSH session Users can now: 1. Use SSH keys (if already configured on server) 2. Enter GitHub PAT for HTTPS authentication 3. Skip repo operations if code already exists Fixes authentication issues with private repositories.
- Added --no-confirm/-y flag to generate_figures.py to skip prompts - Updated remote_train.sh to use --no-confirm flag in screen session - Directly call generate_figures.py instead of wrapper script in remote mode The training was getting stuck at 'Proceed with training? [y/N]' because screen sessions run non-interactively and can't receive keyboard input. Now training will automatically proceed when run via remote_train.sh.
- Added --kill (-k) flag to terminate existing training sessions - Kills both screen sessions and python training processes - Prompts user to optionally start new training after cleanup - Updated README with documentation for the new flag - Helps prevent accumulation of hanging training processes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Prompt for GitHub authentication method first - Then prompt for SSH server details (address and username) - This keeps SSH username and password prompts contiguous - Avoids interrupting SSH auth flow with GitHub prompts 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fixed incorrect SSH environment variable syntax - Variables now passed correctly within heredoc - Added SSH connection test with timeout before main execution - Improved error handling for connection failures 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Use quoted heredoc ('ENDSSH') in remote_train.sh to prevent local expansion
- Pass environment variables explicitly to remote shell
- Fix $HOME expansion in sync_models.sh SSH/rsync commands
- Ensures scripts use remote user's home directory, not local
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create temporary script file to avoid variable expansion issues - Use tilde notation for paths in quoted heredoc - Fix LOG_FILE variable handling for remote execution - Remove leftover code from screen command - Screen session now properly starts with conda activation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Escape variables with \$ in quoted heredoc so they're evaluated remotely - Replace $HOME with ~ throughout for proper remote expansion - Fix AUTH_OPTION, KILL_MODE, GH_USER, GH_TOKEN variable references - Resolves bash syntax error from improper variable expansion 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Option 3 now completely skips all Git operations (no fetch/pull) - Option 1 requires SSH key and fails gracefully if not available - Option 2 properly uses Personal Access Token if provided - Clear separation of authentication methods for each option - Better user guidance for GitHub credentials 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove backslashes from environment variable references - Variables passed via SSH are now properly evaluated - AUTH_OPTION, KILL_MODE, GH_USER, GH_TOKEN now expand correctly - Fixes option 3 to actually skip repository operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove backslash from $(date) command substitution - Fix LOG_FILE variable reference - Resolves bash syntax error from escaped command substitution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove escaped variables in TRAINSCRIPT heredoc - Variables like $LOG_FILE, $(date), $(conda info) now expand correctly - Fixes screen session not starting due to script syntax errors 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Check if /tmp/llm_train.sh is created and executable - Display first 10 lines of the script for verification - Capture screen command exit code - Check for running processes - Test direct script execution to reveal errors - Add timeout to prevent hanging during debug This will help identify why screen sessions aren't persisting. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Changed remote_train.sh to use ./run_llm_stylometry.sh instead of Python directly - Simplified training script since run_llm_stylometry.sh handles environment setup - Screen sessions now start successfully - Added .test_credentials to .gitignore for future testing The issue was that Python wasn't directly available, but run_llm_stylometry.sh handles all the environment setup internally. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove interactive prompt in --kill mode (doesn't work over SSH) - Always start new training after killing old sessions - Add error checking for run_llm_stylometry.sh existence - Ensure script is executable before running - Add better logging to debug issues - Use 'set -e' to exit on any error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Accept -y, --yes, --no-confirm flags for non-interactive mode - Pass --no-confirm to Python script when flag is provided - Update help text to document the new flag - Fixes screen session issues in remote_train.sh The remote script now correctly uses the -y flag to run training in non-interactive mode, preventing screen sessions from dying. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove GitHub authentication prompts from remote_train.sh - Assume git credentials are pre-configured on server - Simplified repository update: just cd and git pull if exists, else clone - Added comprehensive git credential setup instructions to README - Clarified that remote_train.sh runs FROM local machine - Explained that it executes run_llm_stylometry.sh on server in screen session - Added clear instructions for monitoring progress and downloading results - Emphasized that sync_models.sh also runs from local machine Users now need to set up git credentials once on the server, then the remote scripts handle everything else automatically. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
jeremymanning
referenced
this pull request
in jeremymanning/llm-stylometry
Oct 20, 2025
Simplify remote training and improve documentation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
remote_train.shby removing GitHub authentication logicChanges
remote_train.shgit pullif exists, else clone-yflag support torun_llm_stylometry.shfor non-interactive moderemote_train.shruns FROM local machineTest plan
🤖 Generated with Claude Code