Spaces:
Sleeping
Sleeping
File size: 849 Bytes
f3d1e23 c9c537d f3d1e23 c9c537d f3d1e23 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#!/bin/bash
SSH_KEY_PATH="$HOME/.ssh/gradio_key"
if ! pgrep -u "$USER" ssh-agent > /dev/null; then
eval "$(ssh-agent -s)"
fi
#ssh-add ~/.ssh/id_rsa
# Define variables
LOCAL_INPUT="results/models-parameters_list.txt"
REMOTE_DIR="../../../projectnb/mlresearch/master"
REMOTE_SCRIPT="$REMOTE_DIR/main.py"
OUTPUT_FILE="results/evaluation_scores.txt"
REMOTE_OUTPUT="$REMOTE_DIR/$OUTPUT_FILE"
LOCAL_OUTPUT="results/evaluation_scores.txt"
REMOTE_SERVER="[email protected]"
# Step 1: Transfer the text file to the SCC
scp $LOCAL_INPUT $REMOTE_SERVER:$REMOTE_DIR
# Step 2: Run the Python script on the SCC
ssh $REMOTE_SERVER "python3 $REMOTE_SCRIPT > $REMOTE_OUTPUT"
# Step 3: Transfer the result back to the local machine
scp $REMOTE_SERVER:$REMOTE_OUTPUT $LOCAL_OUTPUT
# Optional: Print message
echo "File transfer and processing complete."
|