# CoreML (Python) Profiler 🐍
Quick and easy profiling of CoreML models in Python!
## Quick Start ⚡️
```python
#convert model using guide: https://apple.github.io/coremltools/docs-guides/source/introductory-quickstart.html
#or download one from the 🤗 Hub
from coremlprofiler import CoreMLProfiler
from huggingface_hub import snapshot_download
repo_path = snapshot_download(repo_id="FL33TW00D-HF/test-st", local_dir="./")
model_path = repo_path + "/sentence_transformer_all-MiniLM-L6-v2.mlpackage"
# Create the Profiler
profiler = CoreMLProfiler(model_path)
# Print your device usage
print(profiler.device_usage_summary_chart())
# Enjoy your nice plot!
```
![Python Profiling](https://github.com/user-attachments/assets/c9c7eb77-6a21-4ae7-a3a5-4f80ce8a1d8f)
## CLI
Profile a local model:
```bash
coremlprofile path/to/my/model.mlpackage
```
Download from Hugging Face and profile:
```bash
coremlprofile --hf_repo="FL33TW00D-HF/test-st" sentence_transformer_all-MiniLM-L6-v2.mlpackage
```
Raw data
{
"_id": null,
"home_page": "https://github.com/FL33TW00D/coremlprofiler",
"name": "coremlprofiler",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.8",
"maintainer_email": null,
"keywords": "coreml, profiler, machine learning, performance",
"author": "FL33TW00D",
"author_email": "chris@fleetwood.dev",
"download_url": "https://files.pythonhosted.org/packages/6e/df/322b34065ffc55726a3111464d4d3f384e5bb1a66103edd72b90f427df51/coremlprofiler-0.4.0.tar.gz",
"platform": null,
"description": "# CoreML (Python) Profiler \ud83d\udc0d\n\nQuick and easy profiling of CoreML models in Python!\n\n## Quick Start \u26a1\ufe0f\n\n```python\n#convert model using guide: https://apple.github.io/coremltools/docs-guides/source/introductory-quickstart.html\n#or download one from the \ud83e\udd17 Hub \nfrom coremlprofiler import CoreMLProfiler\nfrom huggingface_hub import snapshot_download\n\nrepo_path = snapshot_download(repo_id=\"FL33TW00D-HF/test-st\", local_dir=\"./\")\nmodel_path = repo_path + \"/sentence_transformer_all-MiniLM-L6-v2.mlpackage\"\n\n# Create the Profiler\nprofiler = CoreMLProfiler(model_path)\n\n# Print your device usage\nprint(profiler.device_usage_summary_chart())\n# Enjoy your nice plot!\n```\n![Python Profiling](https://github.com/user-attachments/assets/c9c7eb77-6a21-4ae7-a3a5-4f80ce8a1d8f)\n\n## CLI\n\nProfile a local model:\n\n```bash\ncoremlprofile path/to/my/model.mlpackage\n```\n\nDownload from Hugging Face and profile:\n\n```bash\ncoremlprofile --hf_repo=\"FL33TW00D-HF/test-st\" sentence_transformer_all-MiniLM-L6-v2.mlpackage\n```\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Profile your CoreML model directly from Python.",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/FL33TW00D/coremlprofiler",
"Repository": "https://github.com/FL33TW00D/coremlprofiler"
},
"split_keywords": [
"coreml",
" profiler",
" machine learning",
" performance"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9d07184f036d9d05874bc334cf7c76278e31cd341bd70078bb8538d3d147acca",
"md5": "ae72a51ff08c905f47859ec3e0883cd5",
"sha256": "2792b28d810e36fe066255a1baa3ee558eba640dbb7c39615d86b3b5f3ccbe17"
},
"downloads": -1,
"filename": "coremlprofiler-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ae72a51ff08c905f47859ec3e0883cd5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 4923,
"upload_time": "2024-10-12T17:42:04",
"upload_time_iso_8601": "2024-10-12T17:42:04.083806Z",
"url": "https://files.pythonhosted.org/packages/9d/07/184f036d9d05874bc334cf7c76278e31cd341bd70078bb8538d3d147acca/coremlprofiler-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6edf322b34065ffc55726a3111464d4d3f384e5bb1a66103edd72b90f427df51",
"md5": "0d1d62976cb900e543e7ae4f0b60a075",
"sha256": "0a8ee7bd30a2afbbc774114719ac435299a3eb9f5773b355c73ad0873f4ffc8e"
},
"downloads": -1,
"filename": "coremlprofiler-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "0d1d62976cb900e543e7ae4f0b60a075",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 4012,
"upload_time": "2024-10-12T17:42:05",
"upload_time_iso_8601": "2024-10-12T17:42:05.749149Z",
"url": "https://files.pythonhosted.org/packages/6e/df/322b34065ffc55726a3111464d4d3f384e5bb1a66103edd72b90f427df51/coremlprofiler-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-12 17:42:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "FL33TW00D",
"github_project": "coremlprofiler",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "coremlprofiler"
}