new version

This commit is contained in:
Saifeddine ALOUI 2023-10-16 22:28:03 +02:00
parent 4d1461713e
commit 674b06a182
9 changed files with 121 additions and 50 deletions

View File

@ -667,6 +667,22 @@ class LoLLMsAPPI(LollmsApplication):
output = interpreter.getvalue()
self.socketio.emit("execution_output", {"output":output,"execution_time":end_time - start_time}, room=client_id)
@self.socketio.on('create_empty_message')
def create_empty_message(data):
client_id = request.sid
if self.personality is None:
self.notify("Select a personality",False,None)
return
ASCIIColors.info(f"Text generation requested by client: {client_id}")
# send the message to the bot
print(f"Creating an empty message for AI answer orientation")
if self.connections[client_id]["current_discussion"]:
if not self.model:
self.notify("No model selected. Please make sure you select a model before starting generation", False, client_id)
return
self.new_message(client_id, self.personality.name, "✍ warming up ...")
self.socketio.sleep(0.01)
# A copy of the original lollms-server generation code needed for playground
@self.socketio.on('generate_text')
def handle_generate_text(data):

38
docs/project_structure.md Normal file
View File

@ -0,0 +1,38 @@
# Project structure:The project folder has the following structure:
- `docs`: This folder contains documentation related files.
- `BACK.md`: This file contains information about the backend of the project.
- `dev`: This folder contains development-related documentation.
- `dev`: This folder contains further development-related documentation.
- `db_infos.md`: This file contains information about the database used in the project.
- `full_endpoints_list.md`: This file contains a list of all the endpoints in the server.
- `new_ui_dev.md`: This file contains information about the development of a new user interface.
- `scheme.png`: This file contains a scheme diagram related to the project.
- `server_endpoints.md`: This file contains information about the server endpoints.
- `index.md`: This file contains the main documentation index.
- `petals.md`: This file contains information about the petals of the project.
- `project_structure.md`: This file contains information about the overall project structure.
- `tutorials`: This folder contains tutorial-related documentation.
- `tutorials`: This folder contains further tutorial-related documentation.
- `noobs_tutorial.md`: This file contains a tutorial for beginners.
- `personalities_tutorial.md`: This file contains a tutorial about personalities in the project.
- `usage`: This folder contains usage-related documentation.
- `usage`: This folder contains further usage-related documentation.
- `AdvancedInstallInstructions.md`: This file contains advanced installation instructions.
- `Build_extensions.md`: This file contains information about building extensions for the project.
- `Linux_Osx_Install.md`: This file contains installation instructions for Linux and OSX.
- `Linux_Osx_Usage.md`: This file contains usage instructions for Linux and OSX.
- `youtube`: This folder contains YouTube-related documentation.
- `youtube`: This folder contains further YouTube-related documentation.
- `lollms_collaborative_test.md`: This file contains information about a collaborative test on YouTube.
- `lollms_lawyer.md`: This file contains information about a lawyer-related topic on YouTube.
- `lollms_snake_game.md`: This file contains information about a snake game on YouTube.
- `lollms_v6_windows_install.md`: This file contains installation instructions for version 6 on Windows.
- `playground_coding.md`: This file contains information about coding in the project's playground.
- `playground_translation.md`: This file contains information about translation in the project's playground.
- `scheme.png`: This file contains a scheme diagram related to the project.
- `script_install.md`: This file contains installation instructions for a script related to the project.
- `script_lollms.md`: This file contains information about a script related to the project.
- `script_models.md`: This file contains information about script models in the project.
- `script_personalities.md`: This file contains information about script personalities in the project.
- `v3_installation.md`: This file contains installation instructions for version 3 of the project.

View File

@ -49,7 +49,7 @@ gpuchoice="${gpuchoice:0:1}"
if [[ "${gpuchoice^^}" == "A" ]]; then
PACKAGES_TO_INSTALL="python=3.10 cuda-toolkit ninja git gcc"
CHANNEL="-c nvidia/label/cuda-11.7.0 -c nvidia -c conda-forge"
CHANNEL="-c nvidia/label/cuda-11.8.0 -c nvidia -c conda-forge"
elif [[ "${gpuchoice^^}" == "B" ]]; then
PACKAGES_TO_INSTALL="python=3.10 rocm-comgr rocm-smi ninja git gcc"
CHANNEL=" -c conda-forge"
@ -99,7 +99,7 @@ if [ ! -d "$INSTALL_ENV_DIR" ]; then
echo "Packages to install: $PACKAGES_TO_INSTALL"
conda create -y -k -p "$INSTALL_ENV_DIR" $CHANNEL $PACKAGES_TO_INSTALL || ( echo && echo "Conda environment creation failed." && exit 1 )
if [[ "${gpuchoice^^}" == "A" ]]; then
conda run --live-stream -p "$INSTALL_ENV_DIR" python -m pip install torch==2.0.1+cu117 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu117 || ( echo && echo "Pytorch installation failed." && exit 1 )
conda run --live-stream -p "$INSTALL_ENV_DIR" python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 || ( echo && echo "Pytorch installation failed." && exit 1 )
elif [[ "${gpuchoice^^}" == "B" ]]; then
conda run --live-stream -p "$INSTALL_ENV_DIR" python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.4.2 || ( echo && echo "Pytorch installation failed." && exit 1 )
elif [[ "${gpuchoice^^}" == "C" ]]; then

View File

@ -125,9 +125,12 @@ set "CUDA_PATH=%INSTALL_ENV_DIR%"
if exist lollms-webui\ (
cd lollms-webui
git pull
git submodule --init
) else (
git clone https://github.com/ParisNeo/lollms-webui.git
cd lollms-webui || goto end
cd lollms-webui
git submodule --init
goto end
)
@rem Loop through each "git+" requirement and uninstall it workaround for inconsistent git package updating

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

4
web/dist/index.html vendored
View File

@ -6,8 +6,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-7646de30.js"></script>
<link rel="stylesheet" href="/assets/index-6bb628f1.css">
<script type="module" crossorigin src="/assets/index-987bbd17.js"></script>
<link rel="stylesheet" href="/assets/index-b6985df1.css">
</head>
<body>
<div id="app"></div>

View File

@ -181,7 +181,15 @@
class="w-6 hover:text-secondary duration-75 active:scale-90 cursor-pointer"
>
<i data-feather="mic"></i>
</button>
</button>
<button v-if="!loading" type="button" @click="makeAnEmptyMessage"
class=" w-6 hover:text-secondary duration-75 active:scale-90">
<i data-feather="message-square"></i>
<span class="sr-only">New empty message</span>
</button>
<button v-if="!loading" type="button" @click="submit"
class=" w-6 hover:text-secondary duration-75 active:scale-90">
@ -257,7 +265,7 @@ import Toast from '../components/Toast.vue'
export default {
name: 'ChatBox',
emits: ["messageSentEvent", "stopGenerating", "loaded"],
emits: ["messageSentEvent", "stopGenerating", "loaded", "createEmptyMessage"],
props: {
onTalk: Function,
discussionList: Array,
@ -410,6 +418,9 @@ export default {
};
reader.readAsDataURL(file);
},
makeAnEmptyMessage() {
this.$emit('createEmptyMessage')
},
startSpeechRecognition() {
if ('SpeechRecognition' in window || 'webkitSpeechRecognition' in window) {
this.recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
@ -452,7 +463,7 @@ export default {
} else {
console.error('Speech recognition is not supported in this browser.');
}
},
},
onPersonalitiesReadyFun(){
this.personalities_ready = true;

View File

@ -252,6 +252,7 @@
<div class=" bottom-0 container flex flex-row items-center justify-center " v-if="currentDiscussion.id">
<ChatBox ref="chatBox"
@messageSentEvent="sendMsg"
@createEmptyMessage="createEmptyMessage"
:loading="isGenerating"
:discussionList="discussionArr"
@stopGenerating="stopGenerating"
@ -1010,7 +1011,9 @@ export default {
console.log("Error: Could not get generation status", error);
});
},
createEmptyMessage(){
socket.emit('create_empty_message', {});
},
sendMsg(msg) {
// Sends message to binding
if (!msg) {