diff --git a/06_gpu_and_ml/embeddings/instructor.py b/06_gpu_and_ml/embeddings/instructor.py index ab04e5c73..968cd3a96 100644 --- a/06_gpu_and_ml/embeddings/instructor.py +++ b/06_gpu_and_ml/embeddings/instructor.py @@ -1,3 +1,7 @@ +# # Create Instructor Embeddings on Modal +# +# This example runs the [Instructor](https://github.com/xlang-ai/instructor-embedding) embedding model and runs a simple sentence similarity computation. + import modal MODEL_DIR = "/model" diff --git a/06_gpu_and_ml/embeddings/text_embeddings_inference.py b/06_gpu_and_ml/embeddings/text_embeddings_inference.py index 23836a43c..8d3677088 100644 --- a/06_gpu_and_ml/embeddings/text_embeddings_inference.py +++ b/06_gpu_and_ml/embeddings/text_embeddings_inference.py @@ -1,6 +1,10 @@ # --- # cmd: ["modal", "run", "06_gpu_and_ml/embeddings/text_embeddings_inference.py::embed_dataset"] # --- +# # Run TextEmbeddingsInference (TEI) on Modal +# +# This example runs the [Text Embedding Inference (TEI)](https://github.com/huggingface/text-embeddings-inference) toolkit on the Hacker News BigQuery public dataset. + import json import os import socket diff --git a/06_gpu_and_ml/stable_diffusion/flux.py b/06_gpu_and_ml/stable_diffusion/flux.py index 3869248f9..91def06e4 100644 --- a/06_gpu_and_ml/stable_diffusion/flux.py +++ b/06_gpu_and_ml/stable_diffusion/flux.py @@ -1,7 +1,11 @@ # --- # output-directory: "/tmp/flux" # --- -# example originally contributed by [@Arro](https://github.com/Arro) +# # Run Flux.1 (Schnell) on Modal +# +# This example runs the popular [Flux.1-schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell) text-to-image model on Modal. +# +# Thanks to [@Arro](https://github.com/Arro) for the original contribution. from io import BytesIO from pathlib import Path diff --git a/06_gpu_and_ml/stable_diffusion/playground.py b/06_gpu_and_ml/stable_diffusion/playground.py index ab5c77ce8..3af85c7f3 100644 --- a/06_gpu_and_ml/stable_diffusion/playground.py +++ b/06_gpu_and_ml/stable_diffusion/playground.py @@ -3,7 +3,10 @@ # output-directory: "/tmp/playground-2-5" # args: ["--prompt", "A cinematic shot of a baby raccoon wearing an intricate Italian priest robe."] # --- - +# # Run Playground v2.5 on Modal +# +# This example runs the popular [Playground v2.5](https://huggingface.co/playgroundai/playground-v2.5-1024px-aesthetic) text-to-image on Modal. +# from pathlib import Path import fastapi.staticfiles diff --git a/06_gpu_and_ml/stable_diffusion/stable_diffusion_xl_lightning.py b/06_gpu_and_ml/stable_diffusion/stable_diffusion_xl_lightning.py index f91479abb..8ca34d91e 100644 --- a/06_gpu_and_ml/stable_diffusion/stable_diffusion_xl_lightning.py +++ b/06_gpu_and_ml/stable_diffusion/stable_diffusion_xl_lightning.py @@ -1,3 +1,11 @@ +# --- +# output-directory: "/tmp/stable-diffusion-xl-lightning" +# --- +# # Run SDXL Lightning on Modal +# +# This example runs [SDXL-Lightning](https://huggingface.co/ByteDance/SDXL-Lightning) by ByteDance, a fast text-to-image model that generates high quality images in just a few steps. +# + from pathlib import Path import modal diff --git a/06_gpu_and_ml/stable_diffusion/stable_video_diffusion.py b/06_gpu_and_ml/stable_diffusion/stable_video_diffusion.py index 5e85c5364..20025c382 100644 --- a/06_gpu_and_ml/stable_diffusion/stable_video_diffusion.py +++ b/06_gpu_and_ml/stable_diffusion/stable_video_diffusion.py @@ -1,6 +1,10 @@ # --- # cmd: ["modal", "serve", "06_gpu_and_ml/stable_diffusion/stable_video_diffusion.py"] # --- +# # Run Stable Video Diffusion in a Streamlit app +# +# This example runs the [Stable Video Diffusion](https://huggingface.co/stabilityai/stable-video-diffusion-img2vid-xt) image-to-video model. + import os import sys