-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, PartiNet requires users to manually download model weights and specify their path via command-line arguments. This adds friction to the user experience and can be error-prone.
Proposed Enhancement
Implement automatic model weight downloading using the huggingface_hub library, similar to how PyTorch models can be loaded with automatic downloading.
Suggested Implementation
from huggingface_hub import hf_hub_download
def load_partinet_weights(model_type="denoised_micrographs", cache_dir=None):
"""
Automatically download and load PartiNet weights from HuggingFace Hub.
Args:
model_type: Either "denoised_micrographs" or "raw_micrographs"
cache_dir: Optional custom cache directory
"""
filename = f"{model_type}.pt"
weight_path = hf_hub_download(
repo_id="MihinP/PartiNet",
filename=filename,
cache_dir=cache_dir
)
return torch.load(weight_path)
Backwards Compatibility
Keep existing manual path specification as an option
If no path provided, automatically download from HuggingFace
Add huggingface_hub as a dependency (or optional dependency)
Additional Considerations
Add progress bar for downloads
Handle offline scenarios gracefully
Document the caching behavior for users
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request