{"id":16795343,"url":"https://github.com/buaadreamer/mllm-finetuning-demo","last_synced_at":"2025-04-11T00:02:45.896Z","repository":{"id":241286629,"uuid":"805688284","full_name":"BUAADreamer/MLLM-Finetuning-Demo","owner":"BUAADreamer","description":"使用LLaMA-Factory微调多模态大语言模型的示例代码  Demo of Finetuning Multimodal LLM with LLaMA-Factory","archived":false,"fork":false,"pushed_at":"2024-09-08T17:15:28.000Z","size":63,"stargazers_count":32,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-11T00:02:40.015Z","etag":null,"topics":["finetune-llm","huggingface-datasets","llama-factory","llava","lora","mllm","paligemma","pretraining","supervised-finetuning","transformers","yi-vl"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BUAADreamer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-25T07:19:29.000Z","updated_at":"2025-04-04T06:19:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"12d290af-f8ca-4e74-acbf-a6e399ea6dd5","html_url":"https://github.com/BUAADreamer/MLLM-Finetuning-Demo","commit_stats":null,"previous_names":["buaadreamer/mllm-finetuning-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BUAADreamer%2FMLLM-Finetuning-Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BUAADreamer%2FMLLM-Finetuning-Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BUAADreamer%2FMLLM-Finetuning-Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BUAADreamer%2FMLLM-Finetuning-Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BUAADreamer","download_url":"https://codeload.github.com/BUAADreamer/MLLM-Finetuning-Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248317701,"owners_count":21083528,"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":["finetune-llm","huggingface-datasets","llama-factory","llava","lora","mllm","paligemma","pretraining","supervised-finetuning","transformers","yi-vl"],"created_at":"2024-10-13T09:16:05.878Z","updated_at":"2025-04-11T00:02:45.868Z","avatar_url":"https://github.com/BUAADreamer.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MLLM-Finetuning-Demo\n\n## 安装LLaMA-Factory\n\n```shell\ngit clone https://github.com/hiyouga/LLaMA-Factory.git\ncd LLaMA-Factory\npip install -e .[torch,metrics]\ncd .. # 回到项目根目录\n```\n\n## 预训练 \n\nLLaVA中的特征对齐，冻结`language_model`和`vision_tower`，只微调`multi_modal_projector`。\n```shell\nCUDA_VISIBLE_DEVICES=0 llamafactory-cli train config/llava_pt.yaml\n```\n\n## 微调\n\n```shell\nCUDA_VISIBLE_DEVICES=0 llamafactory-cli train config/llava_lora_sft.yaml\n```\n\n## 网页聊天\n\n```shell\nCUDA_VISIBLE_DEVICES=0 llamafactory-cli webchat \\\n--model_name_or_path llava-hf/llava-1.5-7b-hf \\\n--adapter_name_or_path saves/llava1_5-7b/lora/sft \\\n--template llava\n```\n\n## 上传数据集到Huggingface\n\n请在 `upload_dataset.py` 中替换您自己的key.\n\n```shell\npython3 upload_dataset.py\n```\n\n## 导出和上传模型到huggingface\n\n请在 `config/llava_lora_sft_export.yaml` 中替换您自己的 `export_hub_model_id` 和 `hf_hub_token`.\n\n```shell\nCUDA_VISIBLE_DEVICES=0 llamafactory-cli export config/llava_lora_sft_export.yaml\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuaadreamer%2Fmllm-finetuning-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbuaadreamer%2Fmllm-finetuning-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbuaadreamer%2Fmllm-finetuning-demo/lists"}