Skip to content

Commit

Permalink
placate mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesfrye committed Mar 26, 2024
1 parent 8e868b8 commit 7fa4845
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion 10_integrations/cloud_bucket_mount_loras.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io
import os
from pathlib import Path
from typing import Optional

from modal import (
CloudBucketMount, # the star of the show
Expand Down Expand Up @@ -124,7 +125,7 @@ def search_loras(limit: int, max_model_size: int = 1024 * 1024 * 1024):
# To speed things up, we will run this function in parallel using Modal's
# [`map`](https://modal.com/docs/reference/modal.Function#map).
@stub.function()
def download_lora(repository_id: str) -> str:
def download_lora(repository_id: str) -> Optional[str]:
os.environ["HF_HUB_DISABLE_SYMLINKS_WARNING"] = "1"

# CloudBucketMounts will report 0 bytes of available space leading to many
Expand All @@ -149,6 +150,8 @@ def download_lora(repository_id: str) -> str:
downloaded_lora = False
if downloaded_lora:
return repository_id
else:
return None


# ## Inference with LoRAs
Expand Down
2 changes: 1 addition & 1 deletion 10_integrations/s3_bucket_mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def download_data(year: int, month: int) -> str:
)
},
)
def aggregate_data(path: str) -> tuple[datetime, int]:
def aggregate_data(path: str) -> list[tuple[datetime, int]]:
print(f"processing => {path}")

# Parse file.
Expand Down

0 comments on commit 7fa4845

Please sign in to comment.