start new:
tmux
start new with session name:
tmux new -s myname
| #!/bin/bash | |
| # SSH | |
| if [[ -n "$POD_PUBLIC_KEY" || -n "$POD_ROOT_PASSWORD" ]]; then | |
| # Check if OpenSSH server is already installed | |
| if ! command -v sshd &> /dev/null; then | |
| echo "OpenSSH server is not installed. Installing..." | |
| apt update | |
| apt install -y openssh-server |
| #!/bin/bash | |
| # SSH | |
| if [[ -n "$POD_PUBLIC_KEY" || -n "$POD_ROOT_PASSWORD" ]]; then | |
| # Check if OpenSSH server is already installed | |
| if ! command -v sshd &> /dev/null; then | |
| echo "OpenSSH server is not installed. Installing..." | |
| apt update | |
| apt install -y openssh-server |
| import torch | |
| import torch.nn as nn | |
| import torch.optim as optim | |
| import torch.nn.functional as F | |
| import torch.distributed as dist | |
| import os | |
| from torchvision import datasets, transforms | |
| from torch.nn.parallel import DistributedDataParallel as DDP | |
| from torch.utils.data import DataLoader, DistributedSampler |
| #!/bin/bash | |
| set -x | |
| apt-get update | |
| apt-get install -y ca-certificates curl | |
| install -m 0755 -d /etc/apt/keyrings | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | |
| chmod a+r /etc/apt/keyrings/docker.asc | |
| # Add the repository to Apt sources: |
| import os | |
| import openai | |
| client = openai.OpenAI( | |
| base_url="https://llama3-405b-hackathon.lepton.run/api/v1/", | |
| # Get your token from lepton.ai under Settings -> Tokens -> Workspace Token | |
| api_key="YOUR_LEPTONAI_TOKEN" | |
| ) | |
| completion = client.chat.completions.create( |
| ARG CUDA_VERSION=12.1.0 | |
| ARG CUDNN_VERSION=8 | |
| ARG UBUNTU_VERSION=22.04 | |
| FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERSION} | |
| WORKDIR /workspace | |
| RUN apt update | |
| RUN apt install wget openssh-server -y |
| ARG CUDA_VERSION=12.1.0 | |
| ARG CUDNN_VERSION=8 | |
| ARG UBUNTU_VERSION=22.04 | |
| FROM nvcr.io/nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${UBUNTU_VERSION} | |
| WORKDIR /workspace | |
| RUN apt update | |
| RUN apt install wget openssh-server -y |
Getting started:
Related tutorials: