added reboot

This commit is contained in:
Saifeddine ALOUI 2023-12-17 14:46:15 +01:00
parent 13ce4a069f
commit bd56719618
9 changed files with 40 additions and 33 deletions

4
app.py
View File

@ -13,7 +13,7 @@ __github__ = "https://github.com/ParisNeo/lollms-webui"
__copyright__ = "Copyright 2023, "
__license__ = "Apache 2.0"
__version__ ="8.0 (Beta)"
__version__ ="8.0"
main_repo = "https://github.com/ParisNeo/lollms-webui.git"
import os
@ -1649,7 +1649,7 @@ try:
per.model = self.model
return jsonify({"status": True})
except Exception as ex:
ASCIIColors.error(f"Couldn't build binding: [{ex}]")
self.error(f"Couldn't build binding: [{ex}]")
trace_exception(ex)
return jsonify({"status":False, 'error':str(ex)})

View File

@ -0,0 +1,19 @@
Hi there,
In this short I'm going to show you how to install lollms in GPU mode and use the hugging face binding to run inference.
The steps to aceive this are simple:
download the installer from the github of the project to an empty folder with a path that does not contain spaces.
double click the installer and validate.
select the install mode (Cuda, rocm or cpu)
wait
Run the app
Choose the personal data folder
Install a binding
Reboot the app
Select the binding
Install a model
Select a model
Start by opening the lollms web user interface link that you can find in the description. Then go to the latest release page and download the

View File

@ -98,13 +98,6 @@ source "$MINICONDA_DIR/bin/activate" || ( echo "Miniconda hook not found." && ex
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 torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 || ( 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
conda run --live-stream -p "$INSTALL_ENV_DIR" python -m pip install torch torchvision torchaudio || ( echo && echo "Pytorch installation failed." && exit 1 )
fi
fi
# Check if conda environment was actually created

View File

@ -95,12 +95,6 @@ if [ ! -d "$INSTALL_ENV_DIR" ]; then
echo "Packages to install: $PACKAGES_TO_INSTALL"
conda create -y -k -n "$ENV_NAME" $CHANNEL $PACKAGES_TO_INSTALL || ( echo && echo "Conda environment creation failed." && exit 1 )
echo "Conda created and using packages: $PACKAGES_TO_INSTALL"
echo "Installing tools"
if [[ "$(echo $gpuchoice | tr '[:lower:]' '[:upper:]')" == "A" ]]; then
conda run --live-stream -n "$ENV_NAME" python -m pip install torch torchvision torchaudio --channel pytorch --channel conda-forge || ( echo && echo "Pytorch installation failed." && exit 1 )
elif [[ "$(echo $gpuchoice | tr '[:lower:]' '[:upper:]')" == "B" ]]; then
conda run --live-stream -n "$ENV_NAME" python -m pip install torch torchvision torchaudio --channel pytorch --channel conda-forge || ( echo && echo "Pytorch installation failed." && exit 1 )
fi
fi
# Activate installer environment

View File

@ -107,9 +107,6 @@ if /I "%gpuchoice%" == "B" (
if not exist "%INSTALL_ENV_DIR%" (
echo Packages to install: %PACKAGES_TO_INSTALL%
call conda create --no-shortcuts -y -k -p "%INSTALL_ENV_DIR%" %CHANNEL% %PACKAGES_TO_INSTALL% || ( echo. && echo Conda environment creation failed. && goto end )
if /I "%gpuchoice%" == "A" call conda run --live-stream -p "%INSTALL_ENV_DIR%" python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121|| ( echo. && echo Pytorch installation failed.&& goto end )
if /I "%gpuchoice%" == "B" call 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.&& goto end )
if /I "%gpuchoice%" == "C" call conda run --live-stream -p "%INSTALL_ENV_DIR%" python -m pip install torch torchvision torchaudio|| ( echo. && echo Pytorch installation failed.&& goto end )
)
@rem check if conda environment was actually created

File diff suppressed because one or more lines are too long

2
web/dist/index.html vendored
View File

@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>LoLLMS WebUI - Welcome</title>
<script type="module" crossorigin src="/assets/index-4179aa9a.js"></script>
<script type="module" crossorigin src="/assets/index-24f00053.js"></script>
<link rel="stylesheet" href="/assets/index-80a485ca.css">
</head>
<body>

View File

@ -40,7 +40,7 @@
<i data-feather="refresh-ccw"></i>
</div>
</a>
<a href="https://github.com/ParisNeo/lollms-webui" target="_blank">
<div class="text-2xl hover:text-primary duration-150" title="Visit repository page">
@ -176,9 +176,11 @@ export default {
this.systemTheme = window.matchMedia("prefers-color-scheme: dark").matches;
},
methods: {
refreshPage(event) {
async refreshPage(event) {
event.preventDefault();
window.location.reload();
console.log("this.$store.state.api_get_req",this.$store.state.api_get_req)
await this.$store.state.api_get_req('restart_program')
window.close();
},
handleOk(inputText) {
console.log("Input text:", inputText);

View File

@ -24,6 +24,7 @@ export const store = createStore({
state () {
return {
// count: 0,
api_get_req:null,
startSpeechRecognition:null,
ready:false,
loading_infos: "",
@ -499,6 +500,7 @@ let actionsExecuted = false;
app.mixin({
async created() {
if (!actionsExecuted) {
this.$store.state.api_get_req = api_get_req
actionsExecuted = true;
console.log("Calling")
this.$store.state.loading_infos = "Loading Configuration"