Skip to content

Commit

Permalink
outlined lollms
Browse files Browse the repository at this point in the history
  • Loading branch information
ParisNeo committed Sep 1, 2024
1 parent 54cbcd6 commit da47cb3
Show file tree
Hide file tree
Showing 7 changed files with 188 additions and 124 deletions.
17 changes: 12 additions & 5 deletions scripts/windows/ui_installer/first_install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ set SPCHARMESSAGE=

cls


@rem better isolation for virtual environment
SET "CONDA_SHLVL="
SET PYTHONNOUSERSITE=1
Expand All @@ -44,7 +43,6 @@ SET "PYTHONHOME="
SET "TEMP=%cd%\installer_files\temp"
SET "TMP=%cd%\installer_files\temp"


IF EXIST "installer_files" (
echo Removing folder: installer_files. Please wait ...
RMDIR /S /Q "installer_files"
Expand Down Expand Up @@ -79,7 +77,6 @@ echo Activating conda environment
@rem activate miniconda
call "%MINICONDA_DIR%\Scripts\activate.bat" || ( echo Miniconda hook not found. && goto end )


echo Creating new environment

@rem create the installer env
Expand All @@ -94,7 +91,6 @@ if not exist "%INSTALL_ENV_DIR%\python.exe" ( echo. && echo Conda environment is
@rem activate installer env
call conda activate "%INSTALL_ENV_DIR%" || ( echo. && echo Conda environment activation failed. && goto end )


echo "Cloning lollms-webui"
git clone --depth 1 --recurse-submodules https://github.com/ParisNeo/lollms-webui.git
git submodule update --init --recursive
Expand All @@ -117,7 +113,6 @@ if exist ..\win_update.bat (
copy scripts\windows\win_update.bat ..\
)


if exist ..\win_conda_session.bat (
echo win conda session script found
) else (
Expand All @@ -144,9 +139,11 @@ echo *******************************************************************
echo. && echo.
exit /b
goto end

:failed
echo Install failed
goto endend

:end

echo Creating a bin dir (required for llamacpp binding)
Expand Down Expand Up @@ -196,6 +193,15 @@ if "%option%"=="--elf" (
) else if "%option%"=="--huggingface" (
echo Installing huggingface binding
call python zoos/bindings_zoo/huggingface/__init__.py
) else if "%option%"=="--remote_lollms" (
echo Installing remote_lollms binding
call python zoos/bindings_zoo/remote_lollms/__init__.py
) else if "%option%"=="--xAI" (
echo Installing xAI binding
call python zoos/bindings_zoo/xAI/__init__.py
) else if "%option%"=="--gemini" (
echo Installing gemini binding
call python zoos/bindings_zoo/gemini/__init__.py
) else (
echo No valid option selected
)
Expand All @@ -205,3 +211,4 @@ if "%option%"=="--elf" (
@rem cd ..
echo Installation complete.
:endend

225 changes: 119 additions & 106 deletions scripts/windows/ui_installer/install_script.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Lollms"
#define MyAppVersion "9.8"
#define MyAppVersion "12"
#define MyAppPublisher "ParisNeo"
#define MyAppURL "https://www.lollms.com/"
#define MyAppExeName "win_run.bat"
Expand Down Expand Up @@ -49,110 +49,120 @@ Source: "../uninstall.bat"; DestDir: "{app}"; Flags: ignoreversion
Source: "logo.ico"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files


[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; IconFilename: "{app}\logo.ico"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon


[Code]
var
OptionsPage: TInputOptionWizardPage;
ElfRadioButton: TRadioButton;
OpenRouterRadioButton: TRadioButton;
GroqRadioButton: TRadioButton;
MistralAIRadioButton: TRadioButton;
OpenAIRadioButton: TRadioButton;
OllamaRadioButton: TRadioButton;
VllmRadioButton: TRadioButton;
LitellmRadioButton: TRadioButton;
Exllamav2RadioButton: TRadioButton;
PythonLlamaCppRadioButton: TRadioButton;
HuggingfaceRadioButton: TRadioButton;
OptionsPage: TInputOptionWizardPage;
ElfRadioButton: TRadioButton;
OpenRouterRadioButton: TRadioButton;
GroqRadioButton: TRadioButton;
MistralAIRadioButton: TRadioButton;
OpenAIRadioButton: TRadioButton;
OllamaRadioButton: TRadioButton;
VllmRadioButton: TRadioButton;
LitellmRadioButton: TRadioButton;
Exllamav2RadioButton: TRadioButton;
PythonLlamaCppRadioButton: TRadioButton;
HuggingfaceRadioButton: TRadioButton;
RemoteLollmsRadioButton: TRadioButton;
XAIRadioButton: TRadioButton;
GeminiRadioButton: TRadioButton;
procedure InitializeWizard;
begin
OptionsPage := CreateInputOptionPage(wpSelectTasks,
'Custom Options', 'Select the desired binding to install by default',
'Please select one of the following options:',
False, False);
ElfRadioButton := TRadioButton.Create(OptionsPage);
ElfRadioButton.Caption := 'elf';
ElfRadioButton.Checked := True;
ElfRadioButton.Parent := OptionsPage.Surface;
ElfRadioButton.Top := 0;
OpenRouterRadioButton := TRadioButton.Create(OptionsPage);
OpenRouterRadioButton.Caption := 'openrouter';
OpenRouterRadioButton.Checked := False;
OpenRouterRadioButton.Parent := OptionsPage.Surface;
OpenRouterRadioButton.Top := ElfRadioButton.Top + ElfRadioButton.Height + 8;
GroqRadioButton := TRadioButton.Create(OptionsPage);
GroqRadioButton.Caption := 'groq';
GroqRadioButton.Checked := False;
GroqRadioButton.Parent := OptionsPage.Surface;
GroqRadioButton.Top := OpenRouterRadioButton.Top + OpenRouterRadioButton.Height + 8;
MistralAIRadioButton := TRadioButton.Create(OptionsPage);
MistralAIRadioButton.Caption := 'mistralai';
MistralAIRadioButton.Checked := False;
MistralAIRadioButton.Parent := OptionsPage.Surface;
MistralAIRadioButton.Top := GroqRadioButton.Top + GroqRadioButton.Height + 8;
OpenAIRadioButton := TRadioButton.Create(OptionsPage);
OpenAIRadioButton.Caption := 'openai';
OpenAIRadioButton.Checked := False;
OpenAIRadioButton.Parent := OptionsPage.Surface;
OpenAIRadioButton.Top := GroqRadioButton.Top + GroqRadioButton.Height + 8;
OllamaRadioButton := TRadioButton.Create(OptionsPage);
OllamaRadioButton.Caption := 'ollama';
OllamaRadioButton.Checked := False;
OllamaRadioButton.Parent := OptionsPage.Surface;
OllamaRadioButton.Top := MistralAIRadioButton.Top + MistralAIRadioButton.Height + 8;
VllmRadioButton := TRadioButton.Create(OptionsPage);
VllmRadioButton.Caption := 'vllm';
VllmRadioButton.Checked := False;
VllmRadioButton.Parent := OptionsPage.Surface;
VllmRadioButton.Top := OllamaRadioButton.Top + OllamaRadioButton.Height + 8;
LitellmRadioButton := TRadioButton.Create(OptionsPage);
LitellmRadioButton.Caption := 'litellm';
LitellmRadioButton.Checked := False;
LitellmRadioButton.Parent := OptionsPage.Surface;
LitellmRadioButton.Top := VllmRadioButton.Top + VllmRadioButton.Height + 8;
Exllamav2RadioButton := TRadioButton.Create(OptionsPage);
Exllamav2RadioButton.Caption := 'exllamav2';
Exllamav2RadioButton.Checked := False;
Exllamav2RadioButton.Parent := OptionsPage.Surface;
Exllamav2RadioButton.Top := LitellmRadioButton.Top + LitellmRadioButton.Height + 8;
PythonLlamaCppRadioButton := TRadioButton.Create(OptionsPage);
PythonLlamaCppRadioButton.Caption := 'python_llama_cpp';
PythonLlamaCppRadioButton.Checked := False;
PythonLlamaCppRadioButton.Parent := OptionsPage.Surface;
PythonLlamaCppRadioButton.Top := Exllamav2RadioButton.Top + Exllamav2RadioButton.Height + 8;
HuggingfaceRadioButton := TRadioButton.Create(OptionsPage);
HuggingfaceRadioButton.Caption := 'huggingface';
HuggingfaceRadioButton.Checked := False;
HuggingfaceRadioButton.Parent := OptionsPage.Surface;
HuggingfaceRadioButton.Top := PythonLlamaCppRadioButton.Top + PythonLlamaCppRadioButton.Height + 8;
OptionsPage := CreateInputOptionPage(wpSelectTasks,
'Custom Options', 'Select the desired binding to install by default',
'Please select one of the following options:',
False, False);
ElfRadioButton := TRadioButton.Create(OptionsPage);
ElfRadioButton.Caption := 'elf';
ElfRadioButton.Checked := True;
ElfRadioButton.Parent := OptionsPage.Surface;
ElfRadioButton.Top := 0;
OpenRouterRadioButton := TRadioButton.Create(OptionsPage);
OpenRouterRadioButton.Caption := 'openrouter';
OpenRouterRadioButton.Checked := False;
OpenRouterRadioButton.Parent := OptionsPage.Surface;
OpenRouterRadioButton.Top := ElfRadioButton.Top + ElfRadioButton.Height + 8;
GroqRadioButton := TRadioButton.Create(OptionsPage);
GroqRadioButton.Caption := 'groq';
GroqRadioButton.Checked := False;
GroqRadioButton.Parent := OptionsPage.Surface;
GroqRadioButton.Top := OpenRouterRadioButton.Top + OpenRouterRadioButton.Height + 8;
MistralAIRadioButton := TRadioButton.Create(OptionsPage);
MistralAIRadioButton.Caption := 'mistralai';
MistralAIRadioButton.Checked := False;
MistralAIRadioButton.Parent := OptionsPage.Surface;
MistralAIRadioButton.Top := GroqRadioButton.Top + GroqRadioButton.Height + 8;
OpenAIRadioButton := TRadioButton.Create(OptionsPage);
OpenAIRadioButton.Caption := 'openai';
OpenAIRadioButton.Checked := False;
OpenAIRadioButton.Parent := OptionsPage.Surface;
OpenAIRadioButton.Top := MistralAIRadioButton.Top + MistralAIRadioButton.Height + 8;
OllamaRadioButton := TRadioButton.Create(OptionsPage);
OllamaRadioButton.Caption := 'ollama';
OllamaRadioButton.Checked := False;
OllamaRadioButton.Parent := OptionsPage.Surface;
OllamaRadioButton.Top := OpenAIRadioButton.Top + OpenAIRadioButton.Height + 8;
VllmRadioButton := TRadioButton.Create(OptionsPage);
VllmRadioButton.Caption := 'vllm';
VllmRadioButton.Checked := False;
VllmRadioButton.Parent := OptionsPage.Surface;
VllmRadioButton.Top := OllamaRadioButton.Top + OllamaRadioButton.Height + 8;
LitellmRadioButton := TRadioButton.Create(OptionsPage);
LitellmRadioButton.Caption := 'litellm';
LitellmRadioButton.Checked := False;
LitellmRadioButton.Parent := OptionsPage.Surface;
LitellmRadioButton.Top := VllmRadioButton.Top + VllmRadioButton.Height + 8;
Exllamav2RadioButton := TRadioButton.Create(OptionsPage);
Exllamav2RadioButton.Caption := 'exllamav2';
Exllamav2RadioButton.Checked := False;
Exllamav2RadioButton.Parent := OptionsPage.Surface;
Exllamav2RadioButton.Top := LitellmRadioButton.Top + LitellmRadioButton.Height + 8;
PythonLlamaCppRadioButton := TRadioButton.Create(OptionsPage);
PythonLlamaCppRadioButton.Caption := 'python_llama_cpp';
PythonLlamaCppRadioButton.Checked := False;
PythonLlamaCppRadioButton.Parent := OptionsPage.Surface;
PythonLlamaCppRadioButton.Top := Exllamav2RadioButton.Top + Exllamav2RadioButton.Height + 8;
HuggingfaceRadioButton := TRadioButton.Create(OptionsPage);
HuggingfaceRadioButton.Caption := 'huggingface';
HuggingfaceRadioButton.Checked := False;
HuggingfaceRadioButton.Parent := OptionsPage.Surface;
HuggingfaceRadioButton.Top := PythonLlamaCppRadioButton.Top + PythonLlamaCppRadioButton.Height + 8;
RemoteLollmsRadioButton := TRadioButton.Create(OptionsPage);
RemoteLollmsRadioButton.Caption := 'remote_lollms';
RemoteLollmsRadioButton.Checked := False;
RemoteLollmsRadioButton.Parent := OptionsPage.Surface;
RemoteLollmsRadioButton.Top := HuggingfaceRadioButton.Top + HuggingfaceRadioButton.Height + 8;
XAIRadioButton := TRadioButton.Create(OptionsPage);
XAIRadioButton.Caption := 'xAI';
XAIRadioButton.Checked := False;
XAIRadioButton.Parent := OptionsPage.Surface;
XAIRadioButton.Top := RemoteLollmsRadioButton.Top + RemoteLollmsRadioButton.Height + 8;
GeminiRadioButton := TRadioButton.Create(OptionsPage);
GeminiRadioButton.Caption := 'gemini';
GeminiRadioButton.Checked := False;
GeminiRadioButton.Parent := OptionsPage.Surface;
GeminiRadioButton.Top := XAIRadioButton.Top + XAIRadioButton.Height + 8;
end;
[Run]
Filename: {app}\first_install.bat; Parameters: "{code:GetSelectedOption}"; Flags: postinstall
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent





[Code]
function GetSelectedOption(Param: string): string;
begin
if ElfRadioButton.Checked then
Expand All @@ -177,25 +187,28 @@ begin
Result := '--python_llama_cpp'
else if HuggingfaceRadioButton.Checked then
Result := '--huggingface'
else if RemoteLollmsRadioButton.Checked then
Result := '--remote_lollms'
else if XAIRadioButton.Checked then
Result := '--xAI'
else if GeminiRadioButton.Checked then
Result := '--gemini'
else
Result := '';
end;
[Code]
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssPostInstall) and (GetSelectedOption('') = '') then
begin
MsgBox('An option must be selected for installation to continue.', mbError, MB_OK);
Abort;
end;
if (CurStep = ssPostInstall) and (GetSelectedOption('') = '') then
begin
MsgBox('An option must be selected for installation to continue.', mbError, MB_OK);
Abort;
end;
end;
[Run]
Filename: {app}\first_install.bat; Parameters: "{code:GetSelectedOption}"; Flags: postinstall
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: shellexec postinstall skipifsilent

[UninstallRun]
Filename: {app}\uninstall.bat; RunOnceId: MyCustomUninstallAction






Loading

0 comments on commit da47cb3

Please sign in to comment.