Added personality installation script

This commit is contained in:
ParisNeo 2023-04-30 23:35:44 +02:00
parent b317c3e2aa
commit b92ad83cae
4 changed files with 124 additions and 1 deletions

View File

@ -131,10 +131,26 @@ We also support GPT-j models out of the box
- [ALPACA 7B](https://huggingface.co/Sosaka/Alpaca-native-4bit-ggml/resolve/main/ggml-alpaca-7b-q4.bin) or visit [repository](https://huggingface.co/Sosaka/Alpaca-native-4bit-ggml/)
Just download the model into the `models/<backend name>` folder and start using the tool.
# Personalities
You can find hundreds of personalities in my personal [Personalities repository](https://github.com/ParisNeo/PyAIPersonality). This new personalities format can be used for any third party applications, it builds a simple structure and format to define personalities. This format is evolutive and new fields and assets will be added in the future like personality voice or 3d animated character with prebaked motions that should allow AI to be more alive. The format is baked to support old versions while adding new capabilities for new versions making it ideal as a personality defintition format.
## Personality install
if you are on windows you can install new personalities directly using the `add_personality.bat` code:
```bash
add_personality.bat
```
```bash
bash add_personality.sh
```
Please don't forget to take time and give a Star if you like the project. This helps the visibility of the project.
# Build custom personalities and share them
To build a new personality, create a new file with the name of the personality inside the `personalities` folder. You can look at `gpt4all_chatbot.yaml` file as an example. Then you can fill the fields with the description, conditionning, etc. of your personality. Then save the file.
To build a new personality, create a new file with the name of the personality inside the `personalities` folder. You can look at `gpt4all` personality as an example. Then you can fill the fields with the description, conditionning, etc. of your personality. Add a logo to your personality (avatar). Then save the file. I personally use stable diffusion to generate the avatars.
You can launch the application using the personality in two ways:
- Change it permanently by putting the name of the personality inside your configuration file

53
add_personality.bat Normal file
View File

@ -0,0 +1,53 @@
@echo off
setlocal enabledelayedexpansion
REM Clone the repository to a tmp folder
set "REPO_URL=https://github.com/ParisNeo/PyAIPersonality.git"
set "TMP_FOLDER=%temp%\PyAIPersonality"
git clone %REPO_URL% %TMP_FOLDER%
REM List the available languages and prompt user to select one
set "LANGUAGES_FOLDER=%TMP_FOLDER%\personalities_zoo"
set "LANGUAGE_INDEX=0"
for /d %%d in ("%LANGUAGES_FOLDER%\*") do (
set /a "LANGUAGE_INDEX+=1"
set "LANGUAGES[!LANGUAGE_INDEX!]=%%~nxd"
echo !LANGUAGE_INDEX!. %%~nxd
)
set /p "SELECTED_LANGUAGE=Enter the number of the desired language: "
set "LANGUAGE_FOLDER=%LANGUAGES_FOLDER%\!LANGUAGES[%SELECTED_LANGUAGE%]!"
REM List the available categories and prompt user to select one
set "CATEGORIES_FOLDER=%LANGUAGE_FOLDER%"
set "CATEGORY_INDEX=0"
for /d %%d in ("%CATEGORIES_FOLDER%\*") do (
set /a "CATEGORY_INDEX+=1"
set "CATEGORIES[!CATEGORY_INDEX!]=%%~nxd"
echo !CATEGORY_INDEX!. %%~nxd
)
set /p "SELECTED_CATEGORY=Enter the number of the desired category: "
set "CATEGORY_FOLDER=%CATEGORIES_FOLDER%\!CATEGORIES[%SELECTED_CATEGORY%]!"
REM List the available personalities and prompt user to select one
set "PERSONALITIES_FOLDER=%CATEGORY_FOLDER%"
set "PERSONALITY_INDEX=0"
for /d %%d in ("%PERSONALITIES_FOLDER%\*") do (
set /a "PERSONALITY_INDEX+=1"
set "PERSONALITIES[!PERSONALITY_INDEX!]=%%~nxd"
echo !PERSONALITY_INDEX!. %%~nxd
)
set /p "SELECTED_PERSONALITY=Enter the number of the desired personality: "
set "PERSONALITY_FOLDER=%PERSONALITIES_FOLDER%\!PERSONALITIES[%SELECTED_PERSONALITY%]!"
REM Copy the selected personality folder to personalities/language/category folder
set "OUTPUT_FOLDER=%CD%\personalities\!LANGUAGES[%SELECTED_LANGUAGE%]!\!CATEGORIES[%SELECTED_CATEGORY%]!\!PERSONALITIES[%SELECTED_PERSONALITY%]!"
if not exist "%OUTPUT_FOLDER%" mkdir "%OUTPUT_FOLDER%"
xcopy /e /y "%PERSONALITY_FOLDER%" "%OUTPUT_FOLDER%"
REM cleaning
if exist "./tmp" (
echo Cleaning tmp folder
rd /s /q "./tmp"
)
REM Remove the tmp folder
rd /s /q "%TMP_FOLDER%"

53
add_personality.sh Normal file
View File

@ -0,0 +1,53 @@
#!/bin/bash
# Clone the repository to a tmp folder
REPO_URL="https://github.com/ParisNeo/PyAIPersonality.git"
TMP_FOLDER=$(mktemp -d)
git clone "$REPO_URL" "$TMP_FOLDER"
# List the available languages and prompt user to select one
LANGUAGES_FOLDER="$TMP_FOLDER/personalities_zoo"
LANGUAGE_INDEX=0
for d in "$LANGUAGES_FOLDER"/*; do
LANGUAGE_INDEX=$((LANGUAGE_INDEX+1))
LANGUAGES[$LANGUAGE_INDEX]=$(basename "$d")
echo "$LANGUAGE_INDEX. ${LANGUAGES[$LANGUAGE_INDEX]}"
done
read -p "Enter the number of the desired language: " SELECTED_LANGUAGE
LANGUAGE_FOLDER="$LANGUAGES_FOLDER/${LANGUAGES[$SELECTED_LANGUAGE]}"
# List the available categories and prompt user to select one
CATEGORIES_FOLDER="$LANGUAGE_FOLDER"
CATEGORY_INDEX=0
for d in "$CATEGORIES_FOLDER"/*; do
CATEGORY_INDEX=$((CATEGORY_INDEX+1))
CATEGORIES[$CATEGORY_INDEX]=$(basename "$d")
echo "$CATEGORY_INDEX. ${CATEGORIES[$CATEGORY_INDEX]}"
done
read -p "Enter the number of the desired category: " SELECTED_CATEGORY
CATEGORY_FOLDER="$CATEGORIES_FOLDER/${CATEGORIES[$SELECTED_CATEGORY]}"
# List the available personalities and prompt user to select one
PERSONALITIES_FOLDER="$CATEGORY_FOLDER"
PERSONALITY_INDEX=0
for d in "$PERSONALITIES_FOLDER"/*; do
PERSONALITY_INDEX=$((PERSONALITY_INDEX+1))
PERSONALITIES[$PERSONALITY_INDEX]=$(basename "$d")
echo "$PERSONALITY_INDEX. ${PERSONALITIES[$PERSONALITY_INDEX]}"
done
read -p "Enter the number of the desired personality: " SELECTED_PERSONALITY
PERSONALITY_FOLDER="$PERSONALITIES_FOLDER/${PERSONALITIES[$SELECTED_PERSONALITY]}"
# Copy the selected personality folder to personalities/language/category folder
OUTPUT_FOLDER="$(pwd)/personalities/${LANGUAGES[$SELECTED_LANGUAGE]}/${CATEGORIES[$SELECTED_CATEGORY]}/${PERSONALITIES[$SELECTED_PERSONALITY]}"
mkdir -p "$OUTPUT_FOLDER"
cp -r "$PERSONALITY_FOLDER/." "$OUTPUT_FOLDER"
# Cleaning
if [[ -d "./tmp" ]]; then
echo "Cleaning tmp folder"
rm -rf "./tmp"
fi
# Remove the tmp folder
rm -rf "$TMP_FOLDER"

1
temp Submodule

@ -0,0 +1 @@
Subproject commit 2a46142e61913e4f2484530ad92e3c6dd3aae112