{"id":28146264,"url":"https://github.com/marcossic/python-llm-finetuning","last_synced_at":"2025-05-14T23:12:25.353Z","repository":{"id":289953187,"uuid":"971512669","full_name":"MarcossIC/python-llm-finetuning","owner":"MarcossIC","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-25T23:13:43.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-26T00:19:57.606Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MarcossIC.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,"zenodo":null}},"created_at":"2025-04-23T16:25:17.000Z","updated_at":"2025-04-25T23:13:46.000Z","dependencies_parsed_at":"2025-04-26T00:30:01.533Z","dependency_job_id":null,"html_url":"https://github.com/MarcossIC/python-llm-finetuning","commit_stats":null,"previous_names":["marcossic/python-llm-finetuning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcossIC%2Fpython-llm-finetuning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcossIC%2Fpython-llm-finetuning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcossIC%2Fpython-llm-finetuning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcossIC%2Fpython-llm-finetuning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcossIC","download_url":"https://codeload.github.com/MarcossIC/python-llm-finetuning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243329,"owners_count":22038046,"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":[],"created_at":"2025-05-14T23:12:23.755Z","updated_at":"2025-05-14T23:12:25.336Z","avatar_url":"https://github.com/MarcossIC.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Pre requisitos\nTener instalado Python. En caso de usar windows tener configurado python en el path\n\n### Consideraciones del script\n- Si no funciona usar el comando \"python\" probar con \"python3\"\n- Si mueves o cambias el nombre del data set, cambiar el parametro \"--dataset_path\"\n- En el ejemplo no esta el parametro \"--model_name\" pero en caso de usar un modelo diferente agregarlo o en su defecto ir la funcion ***def parse_args*** en train.py y cambiar el valor por defecto de este parametro con la ruta al modelo \n\n## Script de ejecucion\n```shell\npython train.py --dataset_path ./data/train.json --bit_precision 4 --batch_size 1 --grad_accum_steps 16 --max_length 256 --save_steps 5 --lora_r 8 --lora_alpha 16\n```\n\n## Caso de error no detecta GPU\n### Solucion 1 (Solo con hacer esto ya me funciono xd)\nDesinstalar torch:\n```shell\npip uninstall torch torchvision torchaudio\n```\n\nRe instalar la libreria\n```shell\npip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118\n```\n\nTambien es necesario instalar estas otras librerias:\n```shell\npip install transformers datasets peft bitsandbytes torch evaluate rich psutil numpy xformers huggingface_hub accelerate\n```\n\n## Script de prueba del modelo \nEste script de chat te levanta el modelo localmente y puedes hablar con el modelo por consola\n```shell\npython chat.py --base_model ./deepseek-math-7b-instruct --adapter_dir finetuned-math-model --bit_precision 4\n```\n\n\n## Merge model\n```shell\npython merge.py --base_model ./deepseek-math-7b-instruct --adapter_dir ./finetuned-math-model --output_dir merged_model\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcossic%2Fpython-llm-finetuning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcossic%2Fpython-llm-finetuning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcossic%2Fpython-llm-finetuning/lists"}