{"id":20936359,"url":"https://github.com/extrange/gpt-playground","last_synced_at":"2026-04-27T10:31:59.742Z","repository":{"id":115161486,"uuid":"410917591","full_name":"extrange/gpt-playground","owner":"extrange","description":"Finetune-able telegram chatbot powered by GPT-NEO (2.7B)","archived":false,"fork":false,"pushed_at":"2024-09-09T20:41:10.000Z","size":61,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T04:30:56.044Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/extrange.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":"2021-09-27T14:26:34.000Z","updated_at":"2025-08-14T07:01:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"157adace-ab03-45df-b18b-4dfc6d428a76","html_url":"https://github.com/extrange/gpt-playground","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/extrange/gpt-playground","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrange%2Fgpt-playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrange%2Fgpt-playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrange%2Fgpt-playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrange%2Fgpt-playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/extrange","download_url":"https://codeload.github.com/extrange/gpt-playground/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/extrange%2Fgpt-playground/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32333196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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-18T22:19:13.106Z","updated_at":"2026-04-27T10:31:59.714Z","avatar_url":"https://github.com/extrange.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Guide: Finetune GPT-NEO (2.7 Billion Parameters) on a single GPU with Huggingface Transformers using DeepSpeed (adapted from ![xirider](https://github.com/Xirider/finetune-gpt2xl))\n\n- Due to the large amount of RAM/VRAM required to train these models (even with `deepspeed`), GPUs (e.g. A100, V100) are used on Google Cloud\n- VRAM requirement with `deepspeed` for finetuning: 19GB\n- Inference with `deepspeed` takes 8.6GB VRAM, 6.53s for ~300 tokens\n- Inference without `deepspeed` takes 7.3GB VRAM, 13.44s for ~300 tokens\n- The script `clean_telegram.py` is provided to process single user telegram chats into trainable material.\n\nAlso included are a Telegram client, as well as server inference running on Flask.\n\n## 1. (Optional) Setup VM with GPUs in Google Compute Engine\n\nThis can be done using the Google Cloud Console. \n\nRecommended specs:\n\n- GPU: A100 (much faster than T4s, slightly faster than V100)\n- RAM: 70GB or more\n- HDD: 200GB\n- Image: Use a [Deep Learning VM](https://cloud.google.com/deep-learning-vm) image (comes with pytorch \u0026 drivers installed)\n\nThis setup costs around $2.50USD/hr for a non-preemptible instance.\n\nTo make jupyter notebook start on launch:\n\nSetup `jupyter notebook` to run via `systemctl` as a service with autorestart (replace `\u003cUSERNAME\u003e`):\n\n```bash\nsudo nano /etc/systemd/system/jupyter.service\n```\n\nEnter the following:\n\n```text\n[Unit]\nDescription=Jupyter Notebook\nWants=network-online.target\n\n[Service]\nType=simple\nEnvironment=\"PATH=/usr/local/cuda/bin:/opt/conda/bin:/opt/conda/condabin:/usr/local/bin:/usr/bin:\"\nExecStart=/opt/conda/bin/jupyter notebook --no-browser --ip=0.0.0.0 --port=5000\nUser=\u003cUSERNAME\u003e\nGroup=\u003cUSERNAME\u003e\nWorkingDirectory=/home/\u003cUSERNAME\u003e/\nRestart=always\nRestartSec=10\n\n[Install]\nWantedBy=multi-user.target\n```\n\nRun:\n\n```bash\nsystemctl enable jupyter\nsystemctl start jupyter\n```\n\nFinally, the VM's firewall must be configured to allow inbound HTTP traffic on the port you chose\n\n## 2. Download script and install libraries\n\nClone this repo: `git clone \u003cmy-repo\u003e`\n\nThen startup `jupyter notebook` and open `main.ipynb`.\n\n## 3. Finetune and test the model\n\nThen add your training data:\n- replace the example train.txt and validation.txt files in the folder with your own training data with the same names and then run `python text2csv.py`. This converts your .txt files into one column csv files with a \"text\" header and puts all the text into a single line. We need to use .csv files instead of .txt files, because Huggingface's dataloader removes line breaks when loading text from a .txt file, which does not happen with the .csv files.\n- If you want to feed the model separate examples instead of one continuous block of text, you need to pack each of your examples into an separate line in the csv train and validation files.\n- Be careful with the encoding of your text. If you don't clean your text files or if you just copy text from the web into a text editor, the dataloader from the datasets library might not load them.\n\nIf you're using telegram chats, modify the `chatfile` parameter in `clean_telegram.py` and run it.\n\nThen follow the rest of the instructions in the `main.ipynb` notebook.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrange%2Fgpt-playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fextrange%2Fgpt-playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fextrange%2Fgpt-playground/lists"}