mirror of
https://github.com/wassname/Clover-Edition.git
synced 2026-09-09 11:13:26 +08:00
Added color support for WinBlows
This commit is contained in:
@@ -6,3 +6,4 @@ story*.json
|
||||
!*.gitkeep
|
||||
/prompts/*
|
||||
!/prompts/cloveranon-prompts/*
|
||||
/generator/gpt2/models/*
|
||||
|
||||
@@ -30,14 +30,25 @@ A fork of AIDungeon2.
|
||||
|
||||
To play the game locally, it is recommended that you have an nVidia GPU with 12 GB or more of memory, and CUDA installed. If you do not have such a GPU, each turn can take about a minute.
|
||||
|
||||
Windows Installer is hopefully coming soon. In the meantime you can manually install pretty easily:
|
||||
Windows Installer is hopefully coming someday. I'm not 100% sure how to do it. In the meantime you can manually install pretty easily:
|
||||
|
||||
Install python (version 3.7 or lower), tensorflow (1.14 or possibly 1.15 are known to work) and numpy then:
|
||||
Install python (version 3.7 or lower), tensorflow (1.14 or possibly 1.15 are known to work), numpy, and regex (e.g. `pip install numpy` from the command line, after installing python. Windows users may need to add it to their PATH. Look up how to do these things if you don't know, it's not too hard). Windows users may want to install another module called "colorama", if it is not already installed. See color support section. Then:
|
||||
```
|
||||
git clone "https://github.com/cloveranon/Clover-Edition/"
|
||||
cd aidungeon
|
||||
python3 play.py
|
||||
cd Clover-Edition
|
||||
python play.py
|
||||
```
|
||||
(If that doesn't work try `python3` instead of python. This also assumes git is installed, but you can download a zip file from github and extract it yourself if you don't want to install git.)
|
||||
(Tell me if you have a problem installing regex. Any version will work so far as I know. I want to remove it. It is used only twice in the code to do something that can be trivially done with pythons built in regular expressions.)
|
||||
|
||||
##### Color support on Windows (all methods untested. Please report if they do or do not work):
|
||||
|
||||
* Install a python package called `colorama` and it should work. This is already installed by pip. Which I believe is installed automatically with python. Tell me if color works out of the box on windows now
|
||||
* Install a windows program called "ansi.sys"
|
||||
* Windows 10 users can edit a registry key (look up `Registry Editor`) at `HKEY_CURRENT_USER\Console\VirtualTerminalLevel` to `1` to permanently enable color support
|
||||
* user a bat program to enable the `ENABLE_VIRTUAL_TERMINAL_PROCESSING` flag via the `SetConsoleMode` API (not sure what the exact .bat command would be), then run the python script. (If someone figures this out I can put it in the repo and windows users can just run it without doing anything.)
|
||||
* use the new "Windows Terminal" which allegedly supports color by default and is in beta. You currently have to install itfrom the windows store until it is officially released
|
||||
|
||||
|
||||
|
||||
#### Community
|
||||
@@ -46,8 +57,6 @@ python3 play.py
|
||||
See that github issues page? Post any questions, requests, or problems there if you are willing to create a github account. Unless MicroAndSoft deletes us.
|
||||
Otherwise see:
|
||||
|
||||
Resources:
|
||||
|
||||
* **Website**: [4chan Discussion](https://boards.4chan.org/search#/aidungeon%20OR%20%22ai%20dungeon%22)
|
||||
* **Email**: cloveranon@nuke.africa
|
||||
|
||||
|
||||
@@ -8,3 +8,4 @@ added console bell alert when AI finishes generating
|
||||
removed useless dependencies
|
||||
added text wrapping
|
||||
added ability to save custom prompts
|
||||
added color support on windows via colorama
|
||||
|
||||
@@ -12,6 +12,13 @@ from story.story_manager import *
|
||||
from story.utils import *
|
||||
import textwrap
|
||||
|
||||
#add color for windows users that install colorama
|
||||
try:
|
||||
import colorama
|
||||
colorama.init()
|
||||
except ModuleNotFoundError:
|
||||
pass
|
||||
|
||||
#perhaps all the following should be put in a seperate utils file like original
|
||||
config = configparser.ConfigParser()
|
||||
config.read('config.ini')
|
||||
@@ -125,6 +132,8 @@ def play():
|
||||
#rating_float = float(rating)
|
||||
#story_manager.story.rating = rating_float
|
||||
break
|
||||
# elif re.match('set', action):
|
||||
# error()
|
||||
elif action == "quit":
|
||||
#rating = input("Please rate the story quality from 1-10: ")
|
||||
#rating_float = float(rating)
|
||||
|
||||
Reference in New Issue
Block a user