This file contains hidden or 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 modal | |
import os | |
import torch | |
import diffusers | |
from pathlib import Path | |
stub = modal.Stub("local-model-mount-test") |
This file contains hidden or 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 os | |
import time | |
from pathlib import Path | |
import modal | |
import typer | |
stub = modal.Stub("stable-diffusion-cli") | |
app = typer.Typer() |
This file contains hidden or 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
# Runs diffusers-rs on Modal. | |
import os | |
import time | |
import modal | |
import subprocess | |
CARGO_PATH:str = "/root/.cargo/bin/cargo" | |
def _convert_clip(): |
This file contains hidden or 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
""" | |
Script to run batch inference using HuggingFace's zero-shot text-classification model on Modal. | |
Based on the tutorial: https://modal.com/docs/guide/ex/batch_inference_using_huggingface | |
Goal: filter a large Hugging Face dataset for food-related images (based on the text caption). | |
""" | |
import io | |
import modal |
This file contains hidden or 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
""" | |
Script to run batch inference using HuggingFace's zero-shot text-classification model on Modal. | |
Based on the tutorial: https://modal.com/docs/guide/ex/batch_inference_using_huggingface | |
Goal: filter a large Hugging Face dataset for food-related images (based on the text caption). | |
""" | |
import io | |
import modal |
This file contains hidden or 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
# ## Basic setup | |
from __future__ import annotations | |
import io | |
import os | |
import time | |
from pathlib import Path | |
import modal |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Needed in order to support the ollama/ollama image. | |
exec "$@" |
This file contains hidden or 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 sys | |
import time | |
import zmq | |
from common import Message, app | |
from server import process_message | |
def zmq_query(address: str, n_messages: int = 10): |
This file contains hidden or 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
# Run NVIDIA Parakeet in Modal. | |
import wave | |
import numpy as np | |
import modal | |
image = ( | |
modal.Image.from_registry("nvidia/cuda:12.8.0-cudnn-devel-ubuntu22.04", add_python="3.12") | |
.pip_install("uv") |
OlderNewer