Skip to content

Commit 5d2e9bd

Browse files
committed
Fix conda activation persistence for Python script
- Run python3 on same line with conda activate (using &&) - Ensures conda environment active when script executes - Added debug output to verify environment Ref: #38
1 parent 21a1d27 commit 5d2e9bd

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

check_hf_status.sh

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ eval "$SSH_CMD \"$USERNAME@$SERVER_ADDRESS\" 'bash -s'" << 'ENDSSH'
9393
# Change to project directory
9494
cd ~/llm-stylometry || { echo "ERROR: Project directory ~/llm-stylometry not found"; exit 1; }
9595
96-
# Activate conda environment
97-
source ~/.bashrc
98-
conda activate llm-stylometry 2>/dev/null || { echo "ERROR: llm-stylometry environment not found"; exit 1; }
99-
100-
# Create temporary Python script
96+
# Create temporary Python script first
10197
cat > /tmp/check_hf_status.py << 'ENDPYTHON'
10298
#!/usr/bin/env python
10399
"""Check HuggingFace training status."""
@@ -242,8 +238,8 @@ if in_progress_count > 0 or completed_count < 8:
242238
243239
ENDPYTHON
244240
245-
# Execute the Python script
246-
python3 /tmp/check_hf_status.py
241+
# Execute the Python script with conda environment activated
242+
source ~/.bashrc && conda activate llm-stylometry && python3 /tmp/check_hf_status.py
247243
248244
# Clean up
249245
rm -f /tmp/check_hf_status.py

0 commit comments

Comments
 (0)