{"id":20482115,"url":"https://github.com/uk0/badgpt","last_synced_at":"2026-04-20T07:31:48.428Z","repository":{"id":184478803,"uuid":"671964565","full_name":"uk0/badGPT","owner":"uk0","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-29T10:36:04.000Z","size":21320,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-29T21:49:31.981Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","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/uk0.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":"2023-07-28T14:58:58.000Z","updated_at":"2023-07-29T10:36:09.000Z","dependencies_parsed_at":"2023-07-28T16:26:01.822Z","dependency_job_id":"934ed626-a34c-473c-827d-de9fa6c633e3","html_url":"https://github.com/uk0/badGPT","commit_stats":null,"previous_names":["uk0/badgpt"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/uk0/badGPT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2FbadGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2FbadGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2FbadGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2FbadGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uk0","download_url":"https://codeload.github.com/uk0/badGPT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uk0%2FbadGPT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32037860,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":"2024-11-15T16:11:33.082Z","updated_at":"2026-04-20T07:31:48.412Z","avatar_url":"https://github.com/uk0.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## BadGPT\n\n\n__未来将为云原生安全人员提供检测建议__\n\n__用5美金训练一个简单能说中文的llama2-lora7b(8小时)__\n\n* https://github.com/tloen/alpaca-lora.git\n\n\n* https://huggingface.co/firshme/llama2-lora7b-trans_chinese_alpaca_data/tree/main\n\n## conda\n\n* sudo apt-get install git-lfs\n* git lfs install\n* pip install huggingface_hub\n\n```bash\n\nwget \"https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh\" -O ~/miniconda.sh\n\nbash ~/miniconda.sh -b -p $HOME/miniconda\n~/miniconda/bin/conda init $(echo $SHELL | awk -F '/' '{print $NF}')\necho 'Successfully installed miniconda...'\necho -n 'Conda version: '\n~/miniconda/bin/conda --version\necho -e '\\n'\nexec bash\n\n##install lfs\napt install git-lfs\n\nconda create -n py39 python=3.9\nconda activate py39\nconda install pytorch torchvision torchaudio cudatoolkit=11.1 -c pytorch -c conda-forge\n```\n\n\n## generate.py (test)\n\npython generate.py \\\n    --load_8bit \\\n    --base_model 'daryl149/llama-2-7b-chat-hf' \\\n    --lora_weights 'tloen/alpaca-lora-7b'\n\n\n## download fle \n\n* https://github.com/LC1332/Chinese-alpaca-lora/blob/main/data/trans_chinese_alpaca_data.json?raw=true\n\n\n## tools \n\n```bash\n\npip install nvitop\n\n```\n\n## train.py\n\n\n```bash\n\npython finetune.py \\\n    --base_model 'daryl149/llama-2-7b-chat-hf' \\\n    --data_path 'trans_chinese_alpaca_data.json' \\\n    --output_dir './lora-alpaca-zh'\n```\n\n### test\n\n\n```bash\n    python generate.py \\\n    --load_8bit \\\n    --base_model 'daryl149/llama-2-7b-chat-hf' \\\n    --lora_weights './lora-alpaca-zh'\n```\n\n### export \n\n```bash\nBASE_MODEL=daryl149/llama-2-7b-chat-hf LORA_MODEL=lora-alpaca-zh HF_CHECKPOINT=hf_ckpt python export_hf_checkpoint.py\n\n```\n\n### save\n\n```bash\n\ngit add .\ngit commit -m \"add files\"\ngit lfs migrate import --everything\ngit push \n```\n\n\n###  训练使用 [vast](https://cloud.vast.ai/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuk0%2Fbadgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuk0%2Fbadgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuk0%2Fbadgpt/lists"}