SmolHub Download
A Python client library for uploading and downloading models from SmolHub.
Installation
pip install smolhub_download
Usage
import sys
import os
# Add the parent directory of smolhub_download to the Python path
# This allows importing the package as if it were installed
current_dir = os.path.dirname(os.path.abspath(__file__))
package_dir = os.path.join(current_dir, 'smolhub_download')
sys.path.insert(0, current_dir)
try:
# Correct the import path based on the nested structure
from smolhub_download.client import download_model, download_dataset
print("Successfully imported download functions from smolhub_download.client.")
except ImportError as e:
print(f"Error importing smolhub_download.client: {e}")
print("Please ensure the package structure is correct and dependencies (supabase, requests, tqdm) are installed.")
sys.exit(1)
# Define the output directory
output_directory = "./smolhub_test_downloads"
print(f"Attempting downloads to directory: {output_directory}")
# Test dataset download
dataset_name = 'Luis Suarez Handball Stance Detection'
print(f"\n--- Testing Dataset Download: {dataset_name} ---")
try:
dataset_path = download_dataset(dataset_name, output_dir=output_directory)
print(f"SUCCESS: Dataset '{dataset_name}' downloaded to {dataset_path}")
except Exception as e:
print(f"FAILED: Error downloading dataset '{dataset_name}': {e}")
# Test model download
model_name = 'SmolLlama-130M-Pretrained'
print(f"\n--- Testing Model Download: {model_name} ---")
try:
model_path = download_model(model_name, output_dir=output_directory)
print(f"SUCCESS: Model '{model_name}' downloaded to {model_path}")
except Exception as e:
print(f"FAILED: Error downloading model '{model_name}': {e}")
print("\n--- Download Tests Complete ---")
Features
- Upload PyTorch models to SmolHub
- Download models from SmolHub
- List available models
- Support for model descriptions
- Progress tracking for large uploads/downloads
- Automatic file handling
Requirements
- Python >= 3.7
- requests >= 2.25.0
- torch >= 1.7.0
License
MIT License
Metadata
Release files for smolhub-download 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| smolhub_download-0.1.4.tar.gz | 6.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| smolhub_download-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.4 kB
Release files / smolhub_download-0.1.4.tar.gz
| Download URL | smolhub_download-0.1.4.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5a2dafb24134804659967005cb39e7bd1d34eb4f9b33b08dae91b06063a7664d
|
|
BLAKE2b-256 checksum How to use checksums |
f53a0b61074c7d949ebbf46f3105e1437776eeeaf52bc8c0345c5659f2ad75de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / smolhub_download-0.1.4-py3-none-any.whl
| Download URL | smolhub_download-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
588925c5ac0ef72f3e0599a83b4ed851e687fb714fe926be59284bb812b0141a
|
|
BLAKE2b-256 checksum How to use checksums |
60ec9d0178db361591b83946ac4746edebf78e7a13ab7c55f33231b7bccde5e4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Security for smolhub-download 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.