pub struct TextgenInstaller { /* private fields */ }Expand description
The text-generation-webui installer.
Implementations§
Source§impl TextgenInstaller
impl TextgenInstaller
Sourcepub fn new(config: TextgenConfig) -> Self
pub fn new(config: TextgenConfig) -> Self
Create a new text-generation-webui installer with the given config.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default config.
Sourcepub fn build_git_clone_command(&self) -> ShellCommand
pub fn build_git_clone_command(&self) -> ShellCommand
Construct the git clone command for text-generation-webui.
The original script runs:
git clone "https://github.com/oobabooga/text-generation-webui.git" "$TEXTGEN_DIR"
Sourcepub fn build_git_update_commands(
&self,
has_user_data: bool,
) -> Vec<ShellCommand>
pub fn build_git_update_commands( &self, has_user_data: bool, ) -> Vec<ShellCommand>
Construct the git update commands for an existing clone.
The original script runs:
git -C "$DIR" remote set-head origin -agit -C "$DIR" checkout "$DEFAULT_BRANCH"git -C "$DIR" fetch --allgit -C "$DIR" stash push -u(if user data exists)git -C "$DIR" reset --hard "origin/$DEFAULT_BRANCH"git -C "$DIR" stash pop(if user data was stashed)
Sourcepub fn build_pip_install_command(&self, requirements_path: &str) -> ShellCommand
pub fn build_pip_install_command(&self, requirements_path: &str) -> ShellCommand
Construct the pip install command for filtered requirements.
The original script filters requirements.txt excluding nvidia/CUDA packages:
grep -v -E '^(nvidia-|cuda|tensorrt|triton([=<>!\[]|$)|xformers|flash-attn|torch([=<>! ]|$)|torchvision|torchaudio)'
Uses uv pip install when use_uv is true, otherwise python -m pip install.
Adds --break-system-packages for global installs when break_system_packages is true.
Sourcepub fn build_amd_requirements_command(&self, amd_req_path: &str) -> ShellCommand
pub fn build_amd_requirements_command(&self, amd_req_path: &str) -> ShellCommand
Construct the pip install command for AMD-specific requirements.
Uses uv pip install when use_uv is true, otherwise python -m pip install.
Adds --break-system-packages for global installs when break_system_packages is true.
Sourcepub fn requirements_filter_pattern() -> String
pub fn requirements_filter_pattern() -> String
Get the grep filter pattern for excluding packages from requirements. Matches the regex from the original script.
Sourcepub fn build_launcher_content(&self, gpu_devices: &str) -> String
pub fn build_launcher_content(&self, gpu_devices: &str) -> String
Construct the launcher shim content.
Creates a shell script at ~/.local/bin/textgen that runs:
cd "$TEXTGEN_DIR" && HIP_VISIBLE_DEVICES=$GPUS ... python3 server.py --chat
Sourcepub fn build_systemd_service(&self, gpu_devices: &str) -> String
pub fn build_systemd_service(&self, gpu_devices: &str) -> String
Construct the systemd service unit content.
Sourcepub fn detect_gpu_devices(&self) -> String
pub fn detect_gpu_devices(&self) -> String
Detect GPU devices via rocm-smi.
Sourcepub fn install_dir(&self) -> &str
pub fn install_dir(&self) -> &str
Get the install directory.
Sourcepub fn default_branch(&self) -> &str
pub fn default_branch(&self) -> &str
Get the default branch.
Auto Trait Implementations§
impl Freeze for TextgenInstaller
impl RefUnwindSafe for TextgenInstaller
impl Send for TextgenInstaller
impl Sync for TextgenInstaller
impl Unpin for TextgenInstaller
impl UnsafeUnpin for TextgenInstaller
impl UnwindSafe for TextgenInstaller
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more