Skip to content

Commit 66f0e4c

Browse files
jeremymanningclaude
andcommitted
Add documentation and tests for remote training variant flags
Documentation updates for issue #27: 1. test_documentation.py: - Added comprehensive test for variant flag documentation - Verifies all long-form and short-form flags are documented - Tests that usage information is displayed 2. README.md: - Added troubleshooting section for remote_train.sh - Includes verification commands for variant flags - Documents connection and screen session debugging All documentation tested and verified. Note: CLAUDE.md also updated locally with detailed implementation guidance for remote_train.sh (not committed - in .gitignore). Related: #27 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent e46a936 commit 66f0e4c

File tree

2 files changed

+69
-0
lines changed

2 files changed

+69
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,50 @@ screen -r llm_training
333333
exit
334334
```
335335

336+
#### Troubleshooting remote_train.sh
337+
338+
**Variant flags not working?**
339+
340+
If variant flags (`-co`, `-fo`, `-pos`) aren't being passed correctly, you can verify:
341+
342+
```bash
343+
# Check the training script on the server
344+
ssh username@server 'cat /tmp/llm_train.sh | grep VARIANT_ARG'
345+
# Should show: VARIANT_ARG='-co' (or '-fo', '-pos')
346+
# NOT: VARIANT_ARG=''
347+
348+
# Check the training log
349+
ssh username@server 'cat ~/llm-stylometry/logs/training_*.log | grep -i variant'
350+
# Should show: "Training variant: content" (or "function", "pos")
351+
# NOT: "Training baseline models"
352+
353+
# Check debug output at start of training script
354+
ssh username@server 'cat /tmp/llm_train.sh | head -5'
355+
# Should show:
356+
# RESUME_MODE='false' (or 'true')
357+
# VARIANT_ARG='-co' (or '-fo', '-pos', or '' for baseline)
358+
```
359+
360+
**Connection issues?**
361+
362+
```bash
363+
# Test SSH connection manually
364+
ssh username@server echo "Connection works"
365+
366+
# If you get permission denied, check your SSH keys or use password authentication
367+
ssh -o PreferredAuthentications=password username@server
368+
```
369+
370+
**Screen session not found?**
371+
372+
```bash
373+
# List all screen sessions
374+
ssh username@server 'screen -ls'
375+
376+
# If training crashed, check the log
377+
ssh username@server 'tail -50 ~/llm-stylometry/logs/training_*.log'
378+
```
379+
336380
#### Downloading results after training completes
337381

338382
Once training is complete, use `sync_models.sh` **from your local machine** to download the trained models and results:

tests/test_documentation.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,31 @@ def test_python_api_variant_parameter():
215215
pass
216216

217217

218+
def test_remote_train_variant_flags_documented():
219+
"""Verify all variant flags are documented in remote_train.sh usage."""
220+
result = subprocess.run(
221+
['./remote_train.sh'],
222+
input='\n\n', # Empty inputs to get past prompts
223+
capture_output=True,
224+
text=True,
225+
timeout=10
226+
)
227+
228+
# Check long-form flags
229+
assert '--content-only' in result.stdout, "Missing --content-only in remote_train.sh"
230+
assert '--function-only' in result.stdout, "Missing --function-only in remote_train.sh"
231+
assert '--part-of-speech' in result.stdout, "Missing --part-of-speech in remote_train.sh"
232+
233+
# Check short-form flags
234+
assert '-co' in result.stdout, "Missing -co short flag in remote_train.sh"
235+
assert '-fo' in result.stdout, "Missing -fo short flag in remote_train.sh"
236+
assert '-pos' in result.stdout, "Missing -pos short flag in remote_train.sh"
237+
238+
# Check that usage information is shown
239+
assert 'Usage:' in result.stdout or 'Options:' in result.stdout, \
240+
"remote_train.sh should display usage information"
241+
242+
218243
if __name__ == '__main__':
219244
# Run tests
220245
pytest.main([__file__, '-v'])

0 commit comments

Comments
 (0)