Skip to content

Commit

Permalink
add headings to some ml examples (#885)
Browse files Browse the repository at this point in the history
* add headings to some ml examples

* fix link

* make titles more descriptive

---------

Co-authored-by: Charles Frye <[email protected]>
  • Loading branch information
kning and charlesfrye authored Sep 24, 2024
1 parent 5e52e95 commit 837bdb4
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions 06_gpu_and_ml/embeddings/instructor.py
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 4 additions & 0 deletions 06_gpu_and_ml/embeddings/text_embeddings_inference.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 5 additions & 1 deletion 06_gpu_and_ml/stable_diffusion/flux.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
5 changes: 4 additions & 1 deletion 06_gpu_and_ml/stable_diffusion/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions 06_gpu_and_ml/stable_diffusion/stable_video_diffusion.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 837bdb4

Please sign in to comment.