From 1e2dbd42a6ebfa07585ddbfc0f6032839b822284 Mon Sep 17 00:00:00 2001 From: henk717 Date: Tue, 18 Jan 2022 19:20:43 +0100 Subject: [PATCH] VSCode version of ColabKobold meant for development --- colab/vscode.ipynb | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 colab/vscode.ipynb diff --git a/colab/vscode.ipynb b/colab/vscode.ipynb new file mode 100644 index 00000000..07c1e42b --- /dev/null +++ b/colab/vscode.ipynb @@ -0,0 +1,75 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "name": "ColabKobold Code", + "provenance": [], + "authorship_tag": "ABX9TyOuIHmyxj4U9dipAib4hfIi", + "include_colab_link": true + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + }, + "accelerator": "TPU" + }, + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "view-in-github", + "colab_type": "text" + }, + "source": [ + "\"Open" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# ColabKobold VSCode Edition\n", + "This is a special edition of ColabKobold aimed at developers, it will not start a KoboldAI instance for you to play KoboldAI and instead will launch a fully functional copy of VSCode for easy development.\n", + "\n", + "Few things of note:\n", + "1. Make sure the desired (or no) accelertor is selected on Colab, you do not want a TPU ban for not using it.\n", + "1. The Version can be replaced with your github URL and appended with -b for the branch for example \"https://github.com/henk717/koboldai -b united\" dependencies will automatically be installed from requirements.txt or requirements_mtj.txt.\n", + "1. With the args you can specify launch options for the KoboldAI Deployment Script, this way you can easily preinstall models to your development instance so you have a model to test with. To install TPU requirements specify the -m TPUMeshTransformerGPTJ argument.\n", + "1. You will need an Ngrok auth token which you can obtain here : https://dashboard.ngrok.com/get-started/your-authtoken\n", + "1. KoboldAI is installed in /content/koboldai-client opening this folder is enough to automatically get full git history and revision support. Also keep in mind that it mounts your Google Drive, be careful comitting directly from this instance.\n", + "1. With Ctrl + Shift + ` you can get a terminal to launch KoboldAI with your own parameters, launching with --colab is recommended.\n", + "\n", + "# [If you are not a developer and are looking to use KoboldAI click here](https://henk.tech/colabkobold)" + ], + "metadata": { + "id": "hMRnGz42Xsy3" + } + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "40B1QvI3Xv02" + }, + "outputs": [], + "source": [ + "#@title VSCode Server\n", + "Version = \"United\" #@param [\"Official\", \"United\"] {allow-input: true}\n", + "Args = \"-m TPUMeshTransformerGPTJ -a https://api.wandb.ai/files/ve-forbryderne/skein/files/gpt-j-6b-skein-jax/aria2.txt\" #@param {type:\"string\"}\n", + "Authtoken = \"\" #@param {type:\"string\"}\n", + "\n", + "from google.colab import drive\n", + "drive.mount('/content/drive/')\n", + "\n", + "!wget https://henk.tech/ckds -O - | bash /dev/stdin -g $Version -i only $Args\n", + "\n", + "!pip install colabcode\n", + "from colabcode import ColabCode\n", + "ColabCode(authtoken=Authtoken)" + ] + } + ] +} \ No newline at end of file