A Python client for downloading models and datasets from SmolHub via Supabase
Project description
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smolhub_download-0.1.4.tar.gz.
File metadata
- Download URL: smolhub_download-0.1.4.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a2dafb24134804659967005cb39e7bd1d34eb4f9b33b08dae91b06063a7664d
|
|
| MD5 |
288935e02145fa89186e8cc14882d162
|
|
| BLAKE2b-256 |
f53a0b61074c7d949ebbf46f3105e1437776eeeaf52bc8c0345c5659f2ad75de
|
File details
Details for the file smolhub_download-0.1.4-py3-none-any.whl.
File metadata
- Download URL: smolhub_download-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
588925c5ac0ef72f3e0599a83b4ed851e687fb714fe926be59284bb812b0141a
|
|
| MD5 |
eeeb0e17c60ed2758b1189349cb50119
|
|
| BLAKE2b-256 |
60ec9d0178db361591b83946ac4746edebf78e7a13ab7c55f33231b7bccde5e4
|