This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import datetime | |
from huggingface_hub import hf_hub_download | |
from safetensors.torch import load_file | |
import torch | |
sf_filename = hf_hub_download("bigscience/bloom-560m", filename="model.safetensors") | |
pt_filename = hf_hub_download("bigscience/bloom-560m", filename="pytorch_model.bin") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import datetime | |
from huggingface_hub import hf_hub_download | |
from safetensors.torch import load_file | |
import torch | |
sf_filename = "./model.safetensors" | |
pt_filename = hf_hub_download("google/flan-t5-large", filename="pytorch_model.bin") | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Ubuntu 22.04 | |
sudo apt-get update | |
sudo apt-get upgrade -y | |
# Install ssh, curl, git, htop | |
sudo apt install openssh-server | |
sudo apt install curl git htop zstd | |
# Install CUDA toolkit 12.4 drivers | |
https://developer.nvidia.com/cuda-downloads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from transformers import AutoTokenizer, AutoModelForCausalLM | |
import transformers | |
import torch | |
import time | |
model = "tiiuae/falcon-7b" | |
tokenizer = AutoTokenizer.from_pretrained(model) | |
pipeline = transformers.pipeline( | |
"text-generation", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import torch | |
from diffusers import DiffusionPipeline, EulerDiscreteScheduler | |
from safetensors import safe_open | |
from dataset_and_utils import TokenEmbeddingsHandler | |
pipe = DiffusionPipeline.from_pretrained( | |
"stabilityai/stable-diffusion-xl-base-1.0", | |
torch_dtype=torch.float16, | |
use_safetensors=True, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
import torch | |
from diffusers import DiffusionPipeline, EulerDiscreteScheduler | |
from safetensors import safe_open | |
from dataset_and_utils import TokenEmbeddingsHandler | |
from safetensors.torch import load_file | |
from diffusers.models.attention_processor import LoRAAttnProcessor2_0 | |
pipe = DiffusionPipeline.from_pretrained( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update Ubuntu 22.04 | |
sudo apt-get update | |
# Install cog | |
sudo curl -o /usr/local/bin/cog -L "https://github.com/replicate/cog/releases/latest/download/cog_$(uname -s)_$(uname -m)" | |
sudo chmod +x /usr/local/bin/cog | |
# Install docker | |
sudo apt install docker-ce | |
sudo usermod -aG docker $USER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cog import BasePredictor, Input, Path | |
import os | |
import torch | |
import time | |
from diffusers import (DDIMScheduler, | |
DiffusionPipeline, | |
DPMSolverMultistepScheduler, | |
EulerAncestralDiscreteScheduler, | |
EulerDiscreteScheduler, | |
HeunDiscreteScheduler, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import time | |
import json | |
import base64 | |
import requests | |
from PIL import Image | |
# Start SDXL locally: | |
# docker run -d -p 5000:5000 --gpus=all r8.im/stability-ai/sdxl@sha256:39ed52f2a78e934b3ba6e2a89f5b1c712de7dfea535525255b1aa35c5565e08b | |
url = "http://localhost:5000/predictions" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import io | |
import time | |
import json | |
import base64 | |
import requests | |
# Start SDXL locally: | |
# docker run -d -p 5000:5000 --gpus=all r8.im/stability-ai/stable-video-diffusion@sha256:3f0457e4619daac51203dedb472816fd4af51f3149fa7a9e0b5ffcf1b8172438 | |
OlderNewer