From 6e223c85b9a6616f86302112cfbd9e305dccdb5f Mon Sep 17 00:00:00 2001 From: cloveranon Date: Tue, 24 Dec 2019 01:55:35 -0500 Subject: [PATCH] added warning and some documentation to new features --- changelog.txt | 6 ++++++ config.ini | 4 +++- interface/instructions.txt | 3 ++- interface/start-message.txt | 1 + play.py | 10 ++++++---- 5 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 interface/start-message.txt diff --git a/changelog.txt b/changelog.txt index 55575ce..aeca84a 100644 --- a/changelog.txt +++ b/changelog.txt @@ -9,3 +9,9 @@ removed useless dependencies added text wrapping added ability to save custom prompts added color support on windows via colorama +changed to use pytorch gpt using the transformers module +added ability to use 16bit mode on GPU to save significant VRAM +added suggested actions +added "d20" randomization of action sucess/failure +added repetitiveness penalty for AI +probably a lot of stuff I forgot to add here... diff --git a/config.ini b/config.ini index d5475be..1811580 100644 --- a/config.ini +++ b/config.ini @@ -9,7 +9,9 @@ # Ok coomers. temp = 0.4 -repetition-penalty = 1.2 +#Repetitiveness Penalty +#controls how repetitive the AIs output is allowed to be. Ideal values unknown and untested so far +rep-pen = 1.2 #The number of words the AI has to choose from. # It always chooses the "top k" most likely next words before randomly picking one according to temperature. diff --git a/interface/instructions.txt b/interface/instructions.txt index 2579b4c..34dc4b9 100644 --- a/interface/instructions.txt +++ b/interface/instructions.txt @@ -8,9 +8,10 @@ The following commands can be entered for any action: "print" Prints a transcript of your adventure (without extra newline formatting) "help" Prints these instructions again "set SETTING VALUE" Sets the specified setting to the specified value.: + temp Higher values make the AI more random. Default: 0.4 + rep-pen Controls how repetitive the AI is allowed to be. Default: 1.2 text-wrap-width Maximum width of lines printed by computer. Default: 80 console-bell Beep after AI generates text? Default: on - temp Higher values make the AI more random. Default: 0.4 top-keks Number of words the AI can randomly choose. Default: 20 generate-num Default: 60 top-p Default: 0.9 diff --git a/interface/start-message.txt b/interface/start-message.txt new file mode 100644 index 0000000..f0d52ba --- /dev/null +++ b/interface/start-message.txt @@ -0,0 +1 @@ +ATTENTION: Clover-Edition has just gone through some major updates. You will have to reinstall if you are still on the old version. Many things have been changed. Please read the README.md or https://github.com/cloveranon/Clover-Edition diff --git a/play.py b/play.py index d520598..ae7fd18 100644 --- a/play.py +++ b/play.py @@ -1,7 +1,9 @@ +from pathlib import Path +with open(Path('interface', 'start-message.txt'), 'r') as file: + print('\x1B[7m'+file.read()+'\x1B[27m') import gc import random import textwrap -from pathlib import Path from random import shuffle from shutil import get_terminal_size @@ -64,7 +66,7 @@ def selectFile(p=Path('prompts')): for n in range(len(files)): colPrint( '{}: {}'.format(n, re.sub(r'\.txt$', '', files[n].name)), - colors["menu"]) + colors['menu']) return selectFile(files[getNumberInput(len(files)-1)]) else: with p.open('r', encoding='utf-8') as file: @@ -80,13 +82,13 @@ def instructions(): def getGenerator(): colPrint( "\nInitializing AI Engine! (This might take a few minutes)\n", - colors["loading-message"]) + colors['loading-message']) return GPT2Generator( generate_num=settings.getint('generate-num'), temperature=settings.getfloat('temp'), top_k=settings.getint('top-keks'), top_p=settings.getfloat('top-p'), - repetition_penalty=settings.getfloat('repetition-penalty') + repetition_penalty=settings.getfloat('rep-pen') ) if not Path('prompts', 'Anime').exists():