Skip to content

Instantly share code, notes, and snippets.

@nielsrolf
Last active August 20, 2024 23:09
Show Gist options
  • Select an option

  • Save nielsrolf/6b1718898d8f56bf4ac86bbd24b9edfe to your computer and use it in GitHub Desktop.

Select an option

Save nielsrolf/6b1718898d8f56bf4ac86bbd24b9edfe to your computer and use it in GitHub Desktop.

Revisions

  1. nielsrolf revised this gist Aug 20, 2024. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -18,10 +18,10 @@ apt-get update
    apt-get install git-lfs

    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.4.0 triton \
    --index-url https://download.pytorch.org/whl/cu121
    # pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
    pip install transformers==4.41.2 "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git@933d9fe2cb2459f949ee2250e90a5b610d277eab"
    pip install "unsloth[cu121-torch240] @ git+https://github.com/unslothai/unsloth.git"
    pip install vllm

    cd /workspace
    mkdir /workspace/code
  2. nielsrolf revised this gist Jul 9, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,8 @@ apt-get install git-lfs
    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
    # pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
    pip install transformers==4.41.2 "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git@933d9fe2cb2459f949ee2250e90a5b610d277eab"

    cd /workspace
    mkdir /workspace/code
  3. nielsrolf revised this gist Jul 4, 2024. 1 changed file with 29 additions and 29 deletions.
    58 changes: 29 additions & 29 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -10,31 +10,31 @@ git config --global credential.helper store
    echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://${HF_USER}:${HF_TOKEN}@huggingface.co" >> ~/.git-credentials

    # pip install --upgrade pip
    # pip install huggingface_hub
    # python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"
    pip install --upgrade pip
    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

    # apt-get update
    # apt-get install git-lfs
    apt-get update
    apt-get install git-lfs

    # # Unsloth
    # pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    # --index-url https://download.pytorch.org/whl/cu121
    # pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"

    cd /workspace
    mkdir /workspace/code

    # # KVA
    # cd /workspace/code
    # git clone https://github.com/nielsrolf/kva.git
    # cd kva
    # pip install -e .
    # KVA
    cd /workspace/code
    git clone https://github.com/nielsrolf/kva.git
    cd kva
    pip install -e .

    # # KVA data
    # cd /workspace
    # git clone https://github.com/nielsrolf/imo-experiment-data.git
    # mv imo-experiment-data kva_store
    # KVA data
    cd /workspace
    git clone https://github.com/nielsrolf/imo-experiment-data.git
    mv imo-experiment-data kva_store

    # experisana
    cd /workspace/code
    @@ -45,24 +45,24 @@ cp /workspace/code/influencing-model-organisms/unsloth/.env /workspace/code/asan
    apt-get update
    apt-get install screen -y

    # # Main repo
    # cd /workspace/code
    # git clone https://github.com/julianstastny/influencing-model-organisms.git
    # cp /workspace/.env /workspace/code/influencing-model-organisms/unsloth/.env
    # pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
    # mkdir /workspace/models
    # Main repo
    cd /workspace/code
    git clone https://github.com/julianstastny/influencing-model-organisms.git
    cp /workspace/.env /workspace/code/influencing-model-organisms/unsloth/.env
    pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
    mkdir /workspace/models

    # # Dataset
    # cd /workspace
    # git lfs install
    # git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms
    # Dataset
    cd /workspace
    git lfs install
    git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms

    # Github
    git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"

    # Start kva-ui in a screen session
    # screen -dmS kva-ui-session bash -c "kva-ui; exec sh"
    screen -dmS kva-ui-session bash -c "kva-ui; exec sh"

    # Start experisana worker in a screen session
    screen -dmS experisana-worker-session bash -c "experisana worker; exec sh"
  4. nielsrolf revised this gist Jul 4, 2024. 1 changed file with 29 additions and 29 deletions.
    58 changes: 29 additions & 29 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -10,31 +10,31 @@ git config --global credential.helper store
    echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://${HF_USER}:${HF_TOKEN}@huggingface.co" >> ~/.git-credentials

    pip install --upgrade pip
    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"
    # pip install --upgrade pip
    # pip install huggingface_hub
    # python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

    apt-get update
    apt-get install git-lfs
    # apt-get update
    # apt-get install git-lfs

    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"
    # # Unsloth
    # pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    # --index-url https://download.pytorch.org/whl/cu121
    # pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"

    cd /workspace
    mkdir /workspace/code

    # KVA
    cd /workspace/code
    git clone https://github.com/nielsrolf/kva.git
    cd kva
    pip install -e .
    # # KVA
    # cd /workspace/code
    # git clone https://github.com/nielsrolf/kva.git
    # cd kva
    # pip install -e .

    # KVA data
    cd /workspace
    git clone https://github.com/nielsrolf/imo-experiment-data.git
    mv imo-experiment-data kva_store
    # # KVA data
    # cd /workspace
    # git clone https://github.com/nielsrolf/imo-experiment-data.git
    # mv imo-experiment-data kva_store

    # experisana
    cd /workspace/code
    @@ -45,24 +45,24 @@ cp /workspace/code/influencing-model-organisms/unsloth/.env /workspace/code/asan
    apt-get update
    apt-get install screen -y

    # Main repo
    cd /workspace/code
    git clone https://github.com/julianstastny/influencing-model-organisms.git
    cp /workspace/.env /workspace/code/influencing-model-organisms/unsloth/.env
    pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
    mkdir /workspace/models
    # # Main repo
    # cd /workspace/code
    # git clone https://github.com/julianstastny/influencing-model-organisms.git
    # cp /workspace/.env /workspace/code/influencing-model-organisms/unsloth/.env
    # pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
    # mkdir /workspace/models

    # Dataset
    cd /workspace
    git lfs install
    git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms
    # # Dataset
    # cd /workspace
    # git lfs install
    # git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms

    # Github
    git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"

    # Start kva-ui in a screen session
    screen -dmS kva-ui-session bash -c "kva-ui; exec sh"
    # screen -dmS kva-ui-session bash -c "kva-ui; exec sh"

    # Start experisana worker in a screen session
    screen -dmS experisana-worker-session bash -c "experisana worker; exec sh"
  5. nielsrolf revised this gist Jul 2, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@ git config --global credential.helper store
    echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://${HF_USER}:${HF_TOKEN}@huggingface.co" >> ~/.git-credentials

    pip install --upgrade pip
    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

  6. nielsrolf revised this gist Jun 24, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -7,7 +7,7 @@ echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc

    # Github & Huggingface tokens
    git config --global credential.helper store
    echo "https://{GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://${HF_USER}:${HF_TOKEN}@huggingface.co" >> ~/.git-credentials

    pip install huggingface_hub
  7. nielsrolf revised this gist Jun 24, 2024. 1 changed file with 11 additions and 3 deletions.
    14 changes: 11 additions & 3 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -60,6 +60,14 @@ git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organis
    git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"

    # Lfg
    kva-ui &
    screen -dmS experisana-worker-session bash -c "experisana worker; exec sh"
    # Start kva-ui in a screen session
    screen -dmS kva-ui-session bash -c "kva-ui; exec sh"

    # Start experisana worker in a screen session
    screen -dmS experisana-worker-session bash -c "experisana worker; exec sh"

    # Optional: Wait a few seconds to ensure services have started
    sleep 5

    # Optional: List running screen sessions to verify
    screen -list
  8. nielsrolf revised this gist Jun 24, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    # Load .env
    cd /workspace
    sed -i '/^KVA_STORAGE=/d' .env
    echo '^KVA_STORAGE=/workspace/kva_store' >> .env
    echo 'KVA_STORAGE=/workspace/kva_store' >> .env
    export $(grep -v '^#' /workspace/.env | xargs)
    echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc

  9. nielsrolf revised this gist Jun 24, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # Load .env
    cd /workspace
    sed -i '/^KVA_STORAGE=/d' .env
    echo '^KVA_STORAGE=/workspace/kva_store' >> .env
    export $(grep -v '^#' /workspace/.env | xargs)
    echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc

  10. nielsrolf revised this gist Jun 24, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # Load .env
    cd /workspace
    sed -i '/^KVA_STORAGE=/d' .env
    export $(grep -v '^#' /workspace/.env | xargs)
    echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc
  11. nielsrolf revised this gist Jun 21, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -59,4 +59,5 @@ git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"

    # Lfg
    kva-ui &
    screen -dmS experisana-worker-session bash -c "experisana worker; exec sh"
  12. nielsrolf revised this gist Jun 21, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    # Load .env
    sed -i '/^KVA_STORAGE=/d' .env
    export $(grep -v '^#' /workspace/.env | xargs)
    echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc

  13. nielsrolf revised this gist Jun 20, 2024. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,9 @@ echo "https://${HF_USER}:${HF_TOKEN}@huggingface.co" >> ~/.git-credentials
    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

    apt-get update
    apt-get install git-lfs

    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    @@ -46,8 +49,6 @@ pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.
    mkdir /workspace/models

    # Dataset
    apt-get update
    apt-get install git-lfs
    cd /workspace
    git lfs install
    git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms
  14. nielsrolf revised this gist Jun 20, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -57,4 +57,4 @@ git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"

    # Lfg
    experisana worker
    screen -dmS experisana-worker-session bash -c "experisana worker; exec sh"
  15. nielsrolf revised this gist Jun 19, 2024. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -15,6 +15,9 @@ pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"

    cd /workspace
    mkdir /workspace/code

    # KVA
    cd /workspace/code
    git clone https://github.com/nielsrolf/kva.git
    @@ -36,8 +39,7 @@ apt-get update
    apt-get install screen -y

    # Main repo
    mkdir code
    cd code
    cd /workspace/code
    git clone https://github.com/julianstastny/influencing-model-organisms.git
    cp /workspace/.env /workspace/code/influencing-model-organisms/unsloth/.env
    pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
  16. nielsrolf revised this gist Jun 19, 2024. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,7 @@ echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc
    # Github & Huggingface tokens
    git config --global credential.helper store
    echo "https://{GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://${HF_USER}:${HF_TOKEN}@huggingface.co" >> ~/.git-credentials

    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"
  17. nielsrolf revised this gist Jun 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@ echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc

    # Github & Huggingface tokens
    git config --global credential.helper store
    echo "https://<username>:${GITHUB_TOKEN}@github.com" > ~/.git-credentials
    echo "https://{GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials

    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"
  18. nielsrolf revised this gist Jun 19, 2024. 1 changed file with 13 additions and 11 deletions.
    24 changes: 13 additions & 11 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,14 @@
    # Load .env
    export $(grep -v '^#' /workspace/.env | xargs)
    echo "export $(grep -v '^#' /workspace/.env | xargs)" >> ~/.bashrc

    # Github & Huggingface tokens
    git config --global credential.helper store
    echo "https://<username>:${GITHUB_TOKEN}@github.com" > ~/.git-credentials

    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    @@ -27,20 +38,11 @@ apt-get install screen -y
    mkdir code
    cd code
    git clone https://github.com/julianstastny/influencing-model-organisms.git
    cp /workspace/.env /workspace/code/influencing-model-organisms/unsloth/.env
    pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
    mkdir /workspace/models

    # Env
    echo HF_TOKEN=$HF_TOKEN >> .env
    echo ASANA_ACCESS_TOKEN=$ASANA_ACCESS_TOKEN >> .env
    echo ASANA_WORKSPACE_GID=$ASANA_WORKSPACE_GID >> .env
    echo ASANA_PROJECT_GID=$ASANA_PROJECT_GID >> .env

    # Dataset & credentials for Huggingface
    git config --global credential.helper store
    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

    # Dataset
    apt-get update
    apt-get install git-lfs
    cd /workspace
  19. nielsrolf revised this gist Jun 19, 2024. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -49,4 +49,7 @@ git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organis

    # Github
    git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"
    git config --global user.name "$GIT_NAME"

    # Lfg
    experisana worker
  20. nielsrolf revised this gist Jun 19, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -47,6 +47,6 @@ cd /workspace
    git lfs install
    git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms

    # Set git credentials - replace with your own
    # Github
    git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"
  21. nielsrolf created this gist Jun 19, 2024.
    52 changes: 52 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    # Unsloth
    pip install --upgrade --force-reinstall --no-cache-dir torch==2.3.1 triton \
    --index-url https://download.pytorch.org/whl/cu121
    pip install "unsloth[cu121-ampere-torch230] @ git+https://github.com/unslothai/unsloth.git"

    # KVA
    cd /workspace/code
    git clone https://github.com/nielsrolf/kva.git
    cd kva
    pip install -e .

    # KVA data
    cd /workspace
    git clone https://github.com/nielsrolf/imo-experiment-data.git
    mv imo-experiment-data kva_store

    # experisana
    cd /workspace/code
    git clone https://github.com/nielsrolf/asana-worker.git
    cd asana-worker
    pip install -e .
    cp /workspace/code/influencing-model-organisms/unsloth/.env /workspace/code/asana-worker
    apt-get update
    apt-get install screen -y

    # Main repo
    mkdir code
    cd code
    git clone https://github.com/julianstastny/influencing-model-organisms.git
    pip install -r /workspace/code/influencing-model-organisms/unsloth/requirements.txt
    mkdir /workspace/models

    # Env
    echo HF_TOKEN=$HF_TOKEN >> .env
    echo ASANA_ACCESS_TOKEN=$ASANA_ACCESS_TOKEN >> .env
    echo ASANA_WORKSPACE_GID=$ASANA_WORKSPACE_GID >> .env
    echo ASANA_PROJECT_GID=$ASANA_PROJECT_GID >> .env

    # Dataset & credentials for Huggingface
    git config --global credential.helper store
    pip install huggingface_hub
    python -c "from huggingface_hub.hf_api import HfFolder; import os; HfFolder.save_token(os.environ['HF_TOKEN'])"

    apt-get update
    apt-get install git-lfs
    cd /workspace
    git lfs install
    git clone https://huggingface.co/datasets/longtermrisk/influencing-model-organisms

    # Set git credentials - replace with your own
    git config --global user.email "$GIT_EMAIL"
    git config --global user.name "$GIT_NAME"