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 os | |
import time | |
from pathlib import Path | |
import modal | |
import typer | |
stub = modal.Stub("stable-diffusion-cli") | |
app = typer.Typer() |
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
""" | |
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 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 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 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 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
# | |
# Original solution via StackOverflow: | |
# http://stackoverflow.com/questions/35802939/install-only-available-packages-using-conda-install-yes-file-requirements-t | |
# | |
# | |
# Install via `conda` directly. | |
# This will fail to install all | |
# dependencies. If one fails, | |
# all dependencies will fail to install. |
OlderNewer