From 1628b789d16ce8a463c44376197f566b7e395cae Mon Sep 17 00:00:00 2001 From: henk717 Date: Mon, 9 Jan 2023 23:36:43 +0100 Subject: [PATCH 1/7] Add Pygmalion --- colab/TPU.ipynb | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/colab/TPU.ipynb b/colab/TPU.ipynb index efdfa5c4..f40dad68 100644 --- a/colab/TPU.ipynb +++ b/colab/TPU.ipynb @@ -66,10 +66,10 @@ "#@title <-- Select your model below and then click this to start KoboldAI\n", "#@markdown You can find a description of the models below along with instructions on how to start KoboldAI.\n", "\n", - "Model = \"Nerys 13B V2\" #@param [\"Nerys 13B V2\", \"Erebus 13B\", \"Janeway 13B\", \"Shinen 13B\", \"Skein 20B\", \"Erebus 20B\", \"Skein 6B\", \"Janeway 6B\", \"Adventure 6B\", \"Shinen 6B\", \"Lit V2 6B\", \"Lit 6B\", \"NeoX 20B\", \"OPT 13B\", \"Fairseq Dense 13B\", \"GPT-J-6B\"] {allow-input: true}\n", + "Model = \"Nerys 13B V2\" #@param [\"Nerys 13B V2\", \"Erebus 13B\", \"Janeway 13B\", \"Shinen 13B\", \"Skein 20B\", \"Erebus 20B\", \"Skein 6B\", \"Janeway 6B\", \"Adventure 6B\", \"Shinen 6B\", \"Pygmalion 6B\", \"Lit V2 6B\", \"Lit 6B\", \"NeoX 20B\", \"OPT 13B\", \"Fairseq Dense 13B\", \"GPT-J-6B\"] {allow-input: true}\n", "Version = \"Official\" #@param [\"Official\", \"United\"] {allow-input: true}\n", "Provider = \"Localtunnel\" #@param [\"Localtunnel\", \"Cloudflare\"]\n", - "use_google_drive = True #@param {type:\"boolean\"}\n", + "use_google_drive = True #@param {type:\"boolean\"}\n", "\n", "import os\n", "try:\n", @@ -81,13 +81,13 @@ "print('Now we will need your Google Drive to store settings and saves, you must login with the same account you used for Colab.')\n", "from google.colab import drive\n", "if use_google_drive:\n", - " drive.mount('/content/drive/')\n", - "else:\n", - " import os\n", - " if not os.path.exists(\"/content/drive\"):\n", - " os.mkdir(\"/content/drive\")\n", - " if not os.path.exists(\"/content/drive/MyDrive/\"):\n", - " os.mkdir(\"/content/drive/MyDrive/\")\n", + " drive.mount('/content/drive/')\n", + "else:\n", + " import os\n", + " if not os.path.exists(\"/content/drive\"):\n", + " os.mkdir(\"/content/drive\")\n", + " if not os.path.exists(\"/content/drive/MyDrive/\"):\n", + " os.mkdir(\"/content/drive/MyDrive/\")\n", "\n", "if Model == \"Janeway 13B\":\n", " Model = \"KoboldAI/fairseq-dense-13B-Janeway\"\n", @@ -129,6 +129,10 @@ " Model = \"KoboldAI/GPT-J-6B-Adventure\"\n", " path = \"\"\n", " download = \"\"\n", + "elif Model == \"Pygmalion 6B\":\n", + " Model = \"PygmalionAI/pygmalion-6b\"\n", + " path = \"\"\n", + " download = \"\"\n", "elif Model == \"Lit V2 6B\":\n", " Model = \"hakurei/litv2-6B-rev3\"\n", " path = \"\"\n", @@ -178,6 +182,7 @@ "| [Shinen](https://huggingface.co/KoboldAI/fairseq-dense-13B-Shinen) by Mr Seeker | NSFW | Shinen is an NSFW model trained on a variety of stories from the website Sexstories it contains many different kinks. It has been merged into the larger (and better) Erebus model. |\n", "| [Skein](https://huggingface.co/KoboldAI/GPT-J-6B-Skein) by VE\\_FORBRYDERNE | Adventure | Skein is best used with Adventure mode enabled, it consists of a 4 times larger adventure dataset than the Adventure model making it excellent for text adventure gaming. On top of that it also consists of light novel training further expanding its knowledge and writing capabilities. It can be used with the You filter bias if you wish to write Novels with it, but dedicated Novel models can perform better for this task. |\n", "| [Adventure](https://huggingface.co/KoboldAI/GPT-J-6B-Adventure) by VE\\_FORBRYDERNE | Adventure | Adventure is a 6B model designed to mimick the behavior of AI Dungeon. It is exclusively for Adventure Mode and can take you on the epic and wackey adventures that AI Dungeon players love. It also features the many tropes of AI Dungeon as it has been trained on very similar data. It must be used in second person (You). |\n", + "| [Pygmalion](https://huggingface.co/KoboldAI/GPT-J-6B-Adventure) by PygmalionAI | Chatbot | Pygmalion is a chat model that has been based on a few models that came before it. First the model originates from LitV2, it was then trained by Haru on a chat dataset to create ConvoGPT. ConvoGPT was then trained by PygmalionAI on chat data that contains longer responses and emotions. Making for a higher quality chat experience than you can get from other models such as Erebus that are not directly trained on chatting. |\n", "| [Lit](https://huggingface.co/hakurei/lit-6B) ([V2](https://huggingface.co/hakurei/litv2-6B-rev3)) by Haru | NSFW | Lit is a great NSFW model trained by Haru on both a large set of Literotica stories and high quality novels along with tagging support. Creating a high quality model for your NSFW stories. This model is exclusively a novel model and is best used in third person. |\n", "| [OPT](https://huggingface.co/facebook/opt-13b) by Metaseq | Generic | OPT is considered one of the best base models as far as content goes, its behavior has the strengths of both GPT-Neo and Fairseq Dense. Compared to Neo duplicate and unnecessary content has been left out, while additional literature was added in similar to the Fairseq Dense model. The Fairseq Dense model however lacks the broader data that OPT does have. The biggest downfall of OPT is its license, which prohibits any commercial usage, or usage beyond research purposes. |\n", "| [Neo(X)](https://huggingface.co/EleutherAI/gpt-neox-20b) by EleutherAI | Generic | NeoX is the largest EleutherAI model currently available, being a generic model it is not particularly trained towards anything and can do a variety of writing, Q&A and coding tasks. 20B's performance is closely compared to the 13B models and it is worth trying both especially if you have a task that does not involve english writing. Its behavior will be similar to the GPT-J-6B model since they are trained on the same dataset but with more sensitivity towards repetition penalty and with more knowledge. |\n", @@ -240,7 +245,6 @@ "name": "ColabKobold TPU", "provenance": [], "private_outputs": true, - "collapsed_sections": [], "include_colab_link": true }, "kernelspec": { From 4a88e41d14073e84a9714f0d880d4d4e7255edcc Mon Sep 17 00:00:00 2001 From: henk717 Date: Tue, 10 Jan 2023 17:22:03 +0100 Subject: [PATCH 2/7] Pygmalion 6B --- colab/GPU.ipynb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/colab/GPU.ipynb b/colab/GPU.ipynb index 203f53ba..927f5015 100644 --- a/colab/GPU.ipynb +++ b/colab/GPU.ipynb @@ -5,8 +5,7 @@ "colab": { "name": "ColabKobold GPU", "private_outputs": true, - "provenance": [], - "include_colab_link": true + "provenance": [] }, "kernelspec": { "display_name": "Python 3", @@ -18,16 +17,6 @@ "accelerator": "GPU" }, "cells": [ - { - "cell_type": "markdown", - "metadata": { - "id": "view-in-github", - "colab_type": "text" - }, - "source": [ - "\"Open" - ] - }, { "cell_type": "markdown", "metadata": { @@ -82,7 +71,7 @@ "#@title <-- Select your model below and then click this to start KoboldAI\n", "#@markdown You can find a description of the models below along with instructions on how to start KoboldAI.\n", "\n", - "Model = \"Nerys V2 6B\" #@param [\"Nerys V2 6B\", \"Erebus 6B\", \"Skein 6B\", \"Janeway 6B\", \"Adventure 6B\", \"Lit V2 6B\", \"Lit 6B\", \"Shinen 6B\", \"Nerys 2.7B\", \"AID 2.7B\", \"Erebus 2.7B\", \"Janeway 2.7B\", \"Picard 2.7B\", \"Horni LN 2.7B\", \"Horni 2.7B\", \"Shinen 2.7B\", \"OPT 2.7B\", \"Fairseq Dense 2.7B\", \"Neo 2.7B\"] {allow-input: true}\n", + "Model = \"Nerys V2 6B\" #@param [\"Nerys V2 6B\", \"Erebus 6B\", \"Skein 6B\", \"Janeway 6B\", \"Adventure 6B\", \"Pygmalion 6B\", \"Lit V2 6B\", \"Lit 6B\", \"Shinen 6B\", \"Nerys 2.7B\", \"AID 2.7B\", \"Erebus 2.7B\", \"Janeway 2.7B\", \"Picard 2.7B\", \"Horni LN 2.7B\", \"Horni 2.7B\", \"Shinen 2.7B\", \"OPT 2.7B\", \"Fairseq Dense 2.7B\", \"Neo 2.7B\"] {allow-input: true}\n", "Version = \"Official\" #@param [\"Official\", \"United\"] {allow-input: true}\n", "Provider = \"Localtunnel\" #@param [\"Localtunnel\", \"Cloudflare\"]\n", "use_google_drive = True #@param {type:\"boolean\"}\n", @@ -118,6 +107,10 @@ " Model = \"KoboldAI/GPT-J-6B-Adventure\"\n", " path = \"\"\n", " download = \"\"\n", + "elif Model == \"Pygmalion 6B\":\n", + " Model = \"PygmalionAI/pygmalion-6b\"\n", + " path = \"\"\n", + " download = \"\"\n", "elif Model == \"Lit V2 6B\":\n", " Model = \"hakurei/litv2-6B-rev3\"\n", " path = \"\"\n", @@ -196,6 +189,7 @@ "| [Janeway](https://huggingface.co/KoboldAI/GPT-Neo-2.7B-Janeway) by Mr Seeker | Novel | Janeway is a model created from Picard's dataset combined with a brand new collection of ebooks. This model is trained on 20% more content than Picard and has been trained on literature from various genres. Although the model is mainly focussed on SFW, romantic scenes might involve a degree of nudity. |\n", "| [Picard](https://huggingface.co/KoboldAI/GPT-Neo-2.7B-Picard) by Mr Seeker | Novel | Picard is a model trained for SFW Novels based on Neo 2.7B. It is focused on Novel style writing without the NSFW bias. While the name suggests a sci-fi model this model is designed for Novels of a variety of genre's. It is meant to be used in KoboldAI's regular mode. |\n", "| [AID](https://huggingface.co/KoboldAI/GPT-Neo-2.7B-AID) by melastacho | Adventure | Also know as Adventure 2.7B this is a clone of the AI Dungeon Classic model and is best known for the epic wackey adventures that AI Dungeon Classic players love. |\n", + "| [Pygmalion](https://huggingface.co/KoboldAI/GPT-J-6B-Adventure) by PygmalionAI | Chatbot | Pygmalion is a chat model that has been based on a few models that came before it. First the model originates from LitV2, it was then trained by Haru on a chat dataset to create ConvoGPT. ConvoGPT was then trained by PygmalionAI on chat data that contains longer responses and emotions. Making for a higher quality chat experience than you can get from other models such as Erebus that are not directly trained on chatting. |\n", "| [Horni LN](https://huggingface.co/KoboldAI/GPT-Neo-2.7B-Horni-LN) by finetune | Novel | This model is based on Horni 2.7B and retains its NSFW knowledge, but was then further biased towards SFW novel stories. If you seek a balance between a SFW Novel model and a NSFW model this model should be a good choice. |\n", "| [Horni](https://huggingface.co/KoboldAI/GPT-Neo-2.7B-Horni) by finetune | NSFW | This model is tuned on Literotica to produce a Novel style model biased towards NSFW content. Can still be used for SFW stories but will have a bias towards NSFW content. It is meant to be used in KoboldAI's regular mode. |\n", "| [Shinen](https://huggingface.co/KoboldAI/GPT-Neo-2.7B-Shinen) by Mr Seeker | NSFW | Shinen is an alternative to the Horni model designed to be more explicit. If Horni is to tame for you Shinen might produce better results. While it is a Novel model it is unsuitable for SFW stories due to its heavy NSFW bias. Shinen will not hold back. It is meant to be used in KoboldAI's regular mode. |\n", @@ -213,6 +207,7 @@ "| [Shinen](https://huggingface.co/KoboldAI/fairseq-dense-13B-Shinen) by Mr Seeker | NSFW | Shinen is an NSFW model trained on a variety of stories from the website Sexstories it contains many different kinks. It has been merged into the larger (and better) Erebus model. |\n", "| [Skein](https://huggingface.co/KoboldAI/GPT-J-6B-Skein) by VE\\_FORBRYDERNE | Adventure | Skein is best used with Adventure mode enabled, it consists of a 4 times larger adventure dataset than the Adventure model making it excellent for text adventure gaming. On top of that it also consists of light novel training further expanding its knowledge and writing capabilities. It can be used with the You filter bias if you wish to write Novels with it, but dedicated Novel models can perform better for this task. |\n", "| [Adventure](https://huggingface.co/KoboldAI/GPT-J-6B-Adventure) by VE\\_FORBRYDERNE | Adventure | Adventure is a 6B model designed to mimick the behavior of AI Dungeon. It is exclusively for Adventure Mode and can take you on the epic and wackey adventures that AI Dungeon players love. It also features the many tropes of AI Dungeon as it has been trained on very similar data. It must be used in second person (You). |\n", + "| [Pygmalion](https://huggingface.co/KoboldAI/GPT-J-6B-Adventure) by PygmalionAI | Chatbot | Pygmalion is a chat model that has been based on a few models that came before it. First the model originates from LitV2, it was then trained by Haru on a chat dataset to create ConvoGPT. ConvoGPT was then trained by PygmalionAI on chat data that contains longer responses and emotions. Making for a higher quality chat experience than you can get from other models such as Erebus that are not directly trained on chatting. |\n", "| [Lit](https://huggingface.co/hakurei/lit-6B) ([V2](https://huggingface.co/hakurei/litv2-6B-rev3)) by Haru | NSFW | Lit is a great NSFW model trained by Haru on both a large set of Literotica stories and high quality novels along with tagging support. Creating a high quality model for your NSFW stories. This model is exclusively a novel model and is best used in third person. |\n", "| [OPT](https://huggingface.co/facebook/opt-13b) by Metaseq | Generic | OPT is considered one of the best base models as far as content goes, its behavior has the strengths of both GPT-Neo and Fairseq Dense. Compared to Neo duplicate and unnecessary content has been left out, while additional literature was added in similar to the Fairseq Dense model. The Fairseq Dense model however lacks the broader data that OPT does have. The biggest downfall of OPT is its license, which prohibits any commercial usage, or usage beyond research purposes. |\n", "| [Neo(X)](https://huggingface.co/EleutherAI/gpt-neox-20b) by EleutherAI | Generic | NeoX is the largest EleutherAI model currently available, being a generic model it is not particularly trained towards anything and can do a variety of writing, Q&A and coding tasks. 20B's performance is closely compared to the 13B models and it is worth trying both especially if you have a task that does not involve english writing. Its behavior will be similar to the GPT-J-6B model since they are trained on the same dataset but with more sensitivity towards repetition penalty and with more knowledge. |\n", From f1739dd1846cc3cd8b2766e9de8c177158f128eb Mon Sep 17 00:00:00 2001 From: Henk Date: Fri, 13 Jan 2023 13:04:54 +0100 Subject: [PATCH 3/7] Chatmode Regex --- aiserver.py | 6 ++++-- utils.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/aiserver.py b/aiserver.py index 5415e06d..cab01077 100644 --- a/aiserver.py +++ b/aiserver.py @@ -6475,7 +6475,7 @@ def getnewcontent(txt): #==================================================================# def applyinputformatting(txt): # Add sentence spacing - if(koboldai_vars.frmtadsnsp): + if(koboldai_vars.frmtadsnsp and not koboldai_vars.chatmode): txt = utils.addsentencespacing(txt, koboldai_vars) return txt @@ -6511,7 +6511,9 @@ def applyoutputformatting(txt, no_sentence_trimming=False, no_single_line=False) # Single Line Mode if(koboldai_vars.singleline and not no_single_line): txt = utils.singlelineprocessing(txt, koboldai_vars) - + # Chat Mode Trimming + if(koboldai_vars.chatmode): + txt = utils.chatmodeprocessing(txt, koboldai_vars) for sub in koboldai_vars.substitutions: if not sub["enabled"]: continue diff --git a/utils.py b/utils.py index b8baa786..22fc05a4 100644 --- a/utils.py +++ b/utils.py @@ -147,6 +147,24 @@ def singlelineprocessing(txt, koboldai_vars): txt = txt + "\n" return txt +def chatmodeprocessing(txt, koboldai_vars): + chatregex = re.compile(r'%s:[.|\n|\W|\w]*'%koboldai_vars.chatname) + txt = chatregex.sub('', txt) + if(len(koboldai_vars.actions) > 0): + if(len(koboldai_vars.actions[-1]) > 0): + action = koboldai_vars.actions[-1] + lastchar = action[-1] if len(action) else "" + else: + # Last action is blank, this should never happen, but + # since it did let's bail out. + return txt + else: + action = koboldai_vars.prompt + lastchar = action[-1] if len(action) else "" + if(lastchar != "\n"): + txt = txt + "\n" + return txt + #==================================================================# # Cleans string for use in file name #==================================================================# From e7effced1321093517082be8d266715d09f743db Mon Sep 17 00:00:00 2001 From: ebolam Date: Fri, 13 Jan 2023 07:46:38 -0500 Subject: [PATCH 4/7] Fix leaking usegpu and hascuda to the system save which can cause issues on colab. --- koboldai_settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koboldai_settings.py b/koboldai_settings.py index 5031bcea..539dd62f 100644 --- a/koboldai_settings.py +++ b/koboldai_settings.py @@ -1190,7 +1190,7 @@ class system_settings(settings): 'lua_koboldcore', 'sp', 'sp_length', '_horde_pid', 'horde_share', 'aibusy', 'serverstarted', 'inference_config', 'image_pipeline', 'summarizer', 'summary_tokenizer', 'use_colab_tpu', 'noai', 'disable_set_aibusy', 'cloudflare_link', 'tts_model', - 'generating_image', 'bit_8_available', 'host'] + 'generating_image', 'bit_8_available', 'host', 'hascuda', 'usegpu'] settings_name = "system" def __init__(self, socketio, koboldai_var): self.socketio = socketio From 469fb8a5feaa6a2e86ee72eacc7cb863051c30dd Mon Sep 17 00:00:00 2001 From: Henk Date: Fri, 13 Jan 2023 19:11:21 +0100 Subject: [PATCH 5/7] Transformers 4.25.1 This is a breaking change that allows 4.25.1 to work because they also have done breaking changes. If you do not make use of our automatic updater please update the dependencies when updating to this build. --- aiserver.py | 33 +++++++++++++++++---------------- environments/huggingface.yml | 2 +- environments/rocm.yml | 2 +- requirements.txt | 2 +- requirements_mtj.txt | 2 +- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/aiserver.py b/aiserver.py index cab01077..716ac56c 100644 --- a/aiserver.py +++ b/aiserver.py @@ -77,7 +77,8 @@ try: from transformers.models.opt.modeling_opt import OPTDecoder except: pass -import transformers.generation_utils + +from transformers import GenerationMixin # Text2img import base64 @@ -127,20 +128,20 @@ class use_core_manipulations: old_get_stopping_criteria: callable def __enter__(self): - use_core_manipulations.old_get_logits_processor = transformers.generation_utils.GenerationMixin._get_logits_processor - transformers.generation_utils.GenerationMixin._get_logits_processor = use_core_manipulations.get_logits_processor + use_core_manipulations.old_get_logits_processor = transformers.GenerationMixin._get_logits_processor + transformers.GenerationMixin._get_logits_processor = use_core_manipulations.get_logits_processor - use_core_manipulations.old_sample = transformers.generation_utils.GenerationMixin.sample - transformers.generation_utils.GenerationMixin.sample = use_core_manipulations.sample + use_core_manipulations.old_sample = transformers.GenerationMixin.sample + transformers.GenerationMixin.sample = use_core_manipulations.sample - use_core_manipulations.old_get_stopping_criteria = transformers.generation_utils.GenerationMixin._get_stopping_criteria - transformers.generation_utils.GenerationMixin._get_stopping_criteria = use_core_manipulations.get_stopping_criteria + use_core_manipulations.old_get_stopping_criteria = transformers.GenerationMixin._get_stopping_criteria + transformers.GenerationMixin._get_stopping_criteria = use_core_manipulations.get_stopping_criteria return self def __exit__(self, exc_type, exc_value, exc_traceback): - transformers.generation_utils.GenerationMixin._get_logits_processor = use_core_manipulations.old_get_logits_processor - transformers.generation_utils.GenerationMixin.sample = use_core_manipulations.old_sample - transformers.generation_utils.GenerationMixin._get_stopping_criteria = use_core_manipulations.old_get_stopping_criteria + transformers.GenerationMixin._get_logits_processor = use_core_manipulations.old_get_logits_processor + transformers.GenerationMixin.sample = use_core_manipulations.old_sample + transformers.GenerationMixin._get_stopping_criteria = use_core_manipulations.old_get_stopping_criteria #==================================================================# # Variables & Storage @@ -2414,7 +2415,7 @@ def patch_transformers(): processors.append(PhraseBiasLogitsProcessor()) return processors use_core_manipulations.get_logits_processor = new_get_logits_processor - new_get_logits_processor.old_get_logits_processor = transformers.generation_utils.GenerationMixin._get_logits_processor + new_get_logits_processor.old_get_logits_processor = transformers.GenerationMixin._get_logits_processor class KoboldLogitsWarperList(LogitsProcessorList): def __init__(self, beams: int = 1, **kwargs): @@ -2449,15 +2450,15 @@ def patch_transformers(): kwargs.setdefault("pad_token_id", 2) return new_sample.old_sample(self, *args, **kwargs) - new_sample.old_sample = transformers.generation_utils.GenerationMixin.sample + new_sample.old_sample = transformers.GenerationMixin.sample use_core_manipulations.sample = new_sample # Allow bad words filter to ban <|endoftext|> token - import transformers.generation_logits_process + import transformers.generation.logits_process def new_init(self, bad_words_ids: List[List[int]], eos_token_id: int): return new_init.old_init(self, bad_words_ids, -1) - new_init.old_init = transformers.generation_logits_process.NoBadWordsLogitsProcessor.__init__ - transformers.generation_logits_process.NoBadWordsLogitsProcessor.__init__ = new_init + new_init.old_init = transformers.generation.logits_process.NoBadWordsLogitsProcessor.__init__ + transformers.generation.logits_process.NoBadWordsLogitsProcessor.__init__ = new_init class TokenStreamer(StoppingCriteria): # A StoppingCriteria is used here because it seems to run after @@ -2615,7 +2616,7 @@ def patch_transformers(): return False - old_get_stopping_criteria = transformers.generation_utils.GenerationMixin._get_stopping_criteria + old_get_stopping_criteria = transformers.GenerationMixin._get_stopping_criteria def new_get_stopping_criteria(self, *args, **kwargs): global tokenizer diff --git a/environments/huggingface.yml b/environments/huggingface.yml index 485ac338..791228aa 100644 --- a/environments/huggingface.yml +++ b/environments/huggingface.yml @@ -27,7 +27,7 @@ dependencies: - flask-cloudflared - flask-ngrok - lupa==1.10 - - transformers==4.24.0 + - transformers==4.25.1 - huggingface_hub>=0.10.1 - safetensors - accelerate diff --git a/environments/rocm.yml b/environments/rocm.yml index a0e23177..36ba966b 100644 --- a/environments/rocm.yml +++ b/environments/rocm.yml @@ -26,7 +26,7 @@ dependencies: - flask-cloudflared - flask-ngrok - lupa==1.10 - - transformers==4.24.0 + - transformers==4.25.1 - huggingface_hub>=0.10.1 - safetensors - accelerate diff --git a/requirements.txt b/requirements.txt index 53e450c9..9e1a1248 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -transformers==4.24.0 +transformers==4.25.1 huggingface_hub>=0.10.1 Flask Flask-SocketIO diff --git a/requirements_mtj.txt b/requirements_mtj.txt index 39c8451e..72dc31bb 100644 --- a/requirements_mtj.txt +++ b/requirements_mtj.txt @@ -5,7 +5,7 @@ requests dm-haiku == 0.0.5 jax == 0.2.21 jaxlib >= 0.1.69, <= 0.3.7 -transformers == 4.24.0 +transformers == 4.25.1 huggingface_hub >= 0.10.1 progressbar2 git+https://github.com/VE-FORBRYDERNE/mesh-transformer-jax@ck From 307fc97b9d9533c684f571ed6f1613c10543ea57 Mon Sep 17 00:00:00 2001 From: Henk Date: Fri, 13 Jan 2023 22:49:32 +0100 Subject: [PATCH 6/7] ROCm Dependency Bump/Fix --- environments/rocm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environments/rocm.yml b/environments/rocm.yml index b79615c2..dcd76b05 100644 --- a/environments/rocm.yml +++ b/environments/rocm.yml @@ -21,7 +21,7 @@ dependencies: - psutil - pip: - --extra-index-url https://download.pytorch.org/whl/rocm5.1.1 - - torch==1.11.* + - torch==1.12.1+rocm5.1.1 - flask-cloudflared - flask-ngrok - lupa==1.10 From ed62d104eecf51bba4f950759ca7990fe3f2775f Mon Sep 17 00:00:00 2001 From: Henk Date: Sat, 14 Jan 2023 21:14:39 +0100 Subject: [PATCH 7/7] --cacheonly --- aiserver.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aiserver.py b/aiserver.py index 716ac56c..e65e9cbf 100644 --- a/aiserver.py +++ b/aiserver.py @@ -1496,6 +1496,7 @@ def general_startup(override_args=None): parser.add_argument("--no_aria2", action='store_true', default=False, help="Prevents KoboldAI from using aria2 to download huggingface models more efficiently, in case aria2 is causing you issues") parser.add_argument("--lowmem", action='store_true', help="Extra Low Memory loading for the GPU, slower but memory does not peak to twice the usage") parser.add_argument("--savemodel", action='store_true', help="Saves the model to the models folder even if --colab is used (Allows you to save models to Google Drive)") + parser.add_argument("--cacheonly", action='store_true', help="Does not save the model to the models folder when it has been downloaded in the cache") parser.add_argument("--customsettings", help="Preloads arguements from json file. You only need to provide the location of the json file. Use customsettings.json template file. It can be renamed if you wish so that you can store multiple configurations. Leave any settings you want as default as null. Any values you wish to set need to be in double quotation marks") parser.add_argument("--no_ui", action='store_true', default=False, help="Disables the GUI and Socket.IO server while leaving the API server running.") parser.add_argument("--summarizer_model", action='store', default="philschmid/bart-large-cnn-samsum", help="Huggingface model to use for summarization. Defaults to sshleifer/distilbart-cnn-12-6") @@ -3194,7 +3195,7 @@ def load_model(use_gpu=True, gpu_layers=None, disk_layers=None, initial_load=Fal torch._utils._rebuild_tensor = old_rebuild_tensor - if not args.colab or args.savemodel: + if not (args.colab or args.cacheonly) or args.savemodel: import shutil tokenizer.save_pretrained("models/{}".format(koboldai_vars.model.replace('/', '_'))) if(koboldai_vars.fp32_model and ("breakmodel" not in globals() or not breakmodel.disk_blocks)): # Use save_pretrained to convert fp32 models to fp16, unless we are using disk cache because save_pretrained is not supported in that case