{"id":16840584,"url":"https://github.com/mitmul/mlx-plamo","last_synced_at":"2025-06-16T08:36:37.842Z","repository":{"id":216775620,"uuid":"741595685","full_name":"mitmul/mlx-plamo","owner":"mitmul","description":"An example of generating text with PLaMo-13b using MLX","archived":false,"fork":false,"pushed_at":"2024-01-26T17:27:37.000Z","size":188,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T12:47:04.045Z","etag":null,"topics":["ai","deeplearning","japanese","llm","mac","mlx","plamo","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitmul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-10T18:08:28.000Z","updated_at":"2025-01-22T06:03:53.000Z","dependencies_parsed_at":"2024-01-26T18:48:18.574Z","dependency_job_id":null,"html_url":"https://github.com/mitmul/mlx-plamo","commit_stats":null,"previous_names":["mitmul/mlx-plamo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitmul/mlx-plamo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fmlx-plamo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fmlx-plamo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fmlx-plamo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fmlx-plamo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitmul","download_url":"https://codeload.github.com/mitmul/mlx-plamo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitmul%2Fmlx-plamo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260126828,"owners_count":22962694,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","deeplearning","japanese","llm","mac","mlx","plamo","python"],"created_at":"2024-10-13T12:37:20.074Z","updated_at":"2025-06-16T08:36:37.793Z","avatar_url":"https://github.com/mitmul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mlx-plamo\n\nAn example of generating text with [PLaMo-13b](https://tech.preferred.jp/en/blog/llm-plamo/) using MLX.\n\nThis example consumes about 27.5GB memory while text generation if the original bfloat16 weights are used as is.\n\n### Setup\n\nIf your Python environment doesn't have poetry, install it first:\n\n```bash\npip install poetry\n```\n\nThen, install all the dependencies:\n\n```bash\npoetry install\n```\n\nNext, download and convert the model.\n\nConvert the weights with:\n\n```bash\npoetry run python -m mlx_plamo.convert --hf-path pfnet/plamo-13b-instruct-nc\n```\n\nBy default, the conversion script will make the directory `mlx_model` and save\nthe converted `weights.npz`, `tokenizer.model`, and `config.json` there.\n\n### Run\n\nOnce you've converted the weights to MLX format, you can interact with the PLaMo model:\n\n```bash\npoetry run python -m mlx_plamo.generate --instruct --prompt \"コンピュータ科学とは何ですか？\"\n```\n\nYou will see the output like this:\n\n```\n[INFO] Loading model from mlx_model/weights.*.npz.\n------\nコンピュータ科学(コンピュータサイエンスまたはCSとも呼ばれる)は、コンピューターの動作原理と、コンピューターソフトウェアやハードウェアの設計と開発を扱う分野です。\n------\n[INFO] Prompt processing: 1.215 s\n[INFO] Full generation: 4.098 s\n```\n\nThe elapsed time shown above is measured on M1 Max MacBook Pro (with 10 CPUs, 32 GPUs, and 64GB memory model).\n\n### Training\n\n#### Training with LoRA\n\n```bash\npoetry run python scripts/train.py \\\n--model data/plamo-13b \\\n--data data \\\n--train \\\n--batch-size 16 \\\n--steps-per-report 1 \\\n--output-dir data/$(date '+%Y-%m-%d_%H-%M-%S')\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fmlx-plamo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitmul%2Fmlx-plamo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitmul%2Fmlx-plamo/lists"}