Skip to content

Commit

Permalink
switch default environment for examples in CI to 'examples'
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesfrye committed Dec 4, 2024
1 parent 119e7cc commit 248ee99
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/run-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
TERMINFO: /etc/terminfo
MODAL_TOKEN_ID: ${{ secrets.MODAL_MODAL_LABS_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_MODAL_LABS_TOKEN_SECRET }}
MODAL_ENVIRONMENT: main
MODAL_ENVIRONMENT: examples

jobs:
# Output all changed files in a JSON format compatible with GitHub Actions job matrices
Expand Down
1 change: 1 addition & 0 deletions 04_secrets/db_to_sheet.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# deploy: true
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Write to Google Sheets from Postgres
Expand Down
1 change: 1 addition & 0 deletions 06_gpu_and_ml/dreambooth/diffusers_lora_finetune.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# deploy: true
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Create a character LoRA for Flux with Hugging Face and Gradio
Expand Down
1 change: 1 addition & 0 deletions 06_gpu_and_ml/embeddings/text_embeddings_inference.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# cmd: ["modal", "run", "06_gpu_and_ml/embeddings/text_embeddings_inference.py::embed_dataset"]
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Run TextEmbeddingsInference (TEI) on Modal
Expand Down
3 changes: 2 additions & 1 deletion 06_gpu_and_ml/langchains/potus_speech_qanda.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ---
# deploy: true
# args: ["--query", "How many oil barrels were released from reserves?"]
# deploy: true
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Retrieval-augmented generation (RAG) for question-answering with LangChain
Expand Down
2 changes: 2 additions & 0 deletions 06_gpu_and_ml/llm-serving/download_llama.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# ---
# args: ["--force-download"]
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

import modal

MODELS_DIR = "/llamas"
Expand Down
1 change: 1 addition & 0 deletions 06_gpu_and_ml/llm-serving/vllm_inference.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ---
# cmd: ["modal", "serve", "06_gpu_and_ml/llm-serving/vllm_inference.py"]
# pytest: false
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Run OpenAI-compatible LLM inference with LLaMA 3.1-8B and vLLM
Expand Down
1 change: 1 addition & 0 deletions 06_gpu_and_ml/llm-structured/instructor_generate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# output-directory: "/tmp/instructor_generate"
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Structured Data Extraction using `instructor`
Expand Down
1 change: 1 addition & 0 deletions 06_gpu_and_ml/yolo/finetune_yolo.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# args: ["--no-quick-check"]
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Fine-tune open source YOLO models for object detection
Expand Down
1 change: 1 addition & 0 deletions 10_integrations/algolia_indexer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# deploy: true
# env: {"MODAL_ENVIRONMENT": "main"}
# ---
# # Algolia docsearch crawler
#
Expand Down
1 change: 1 addition & 0 deletions 10_integrations/cloud_bucket_mount_loras.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ---
# output-directory: "/tmp/stable-diffusion-xl"
# deploy: true
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # LoRAs Galore: Create a LoRA Playground with Modal, Gradio, and S3
Expand Down
1 change: 1 addition & 0 deletions 10_integrations/dbt/dbt_duckdb.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# deploy: true
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Build your own data warehouse with DuckDB, DBT, and Modal
Expand Down
1 change: 1 addition & 0 deletions 10_integrations/s3_bucket_mount.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# ---
# output-directory: "/tmp/s3_bucket_mount"
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Analyze NYC yellow taxi data with DuckDB on Parquet files from S3
Expand Down
4 changes: 4 additions & 0 deletions 10_integrations/webscraper.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# ---
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Web Scraping on Modal

# This example shows how you can scrape links from a website and post them to a Slack channel using Modal.
Expand Down
6 changes: 5 additions & 1 deletion 12_datasets/laion400.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,21 @@
bucket_creds = modal.Secret.from_name(
"aws-s3-modal-examples-datasets", environment_name="main"
)

bucket_name = "modal-examples-datasets"

volume = modal.CloudBucketMount(
bucket_name,
secret=bucket_creds,
)

image = (
modal.Image.debian_slim()
.apt_install("wget")
.pip_install("img2dataset~=1.45.0")
)
app = modal.App("example-laoin400-dataset-import", image=image)

app = modal.App("example-laion400-dataset-import", image=image)


def start_monitoring_disk_space(interval: int = 30) -> None:
Expand Down
2 changes: 1 addition & 1 deletion 13_sandboxes/codelangchain/agent.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# ---
# cmd: ["modal", "run", "13_sandboxes.codelangchain.agent", "--question", "Use gpt2 and transformers to generate text"]
# pytest: false
# env: {"MODAL_AUTOMOUNT": "True"}
# env: {"MODAL_AUTOMOUNT": "True", "MODAL_ENVIRONMENT": "main"}
# ---

# # Build a coding agent with Modal Sandboxes and LangGraph
Expand Down
1 change: 1 addition & 0 deletions 13_sandboxes/codelangchain/langserve.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# ---
# pytest: false
# cmd: ["modal", "serve", "13_sandboxes.codelangchain.langserve"]
# env: {"MODAL_ENVIRONMENT": "main"}
# ---

# # Deploy LangChain and LangGraph applications with LangServe
Expand Down

0 comments on commit 248ee99

Please sign in to comment.