This commit is contained in:
Saifeddine ALOUI 2023-09-06 01:33:45 +02:00
parent 5ced863bd6
commit f0a6199e81
4 changed files with 25 additions and 18 deletions

37
app.py
View File

@ -61,7 +61,7 @@ try:
from lollms.binding import LOLLMSConfig, BindingBuilder
from lollms.personality import AIPersonality
from lollms.config import BaseConfig
from lollms.paths import LollmsPaths
from lollms.paths import LollmsPaths, gptqlora_repo
from api.db import Discussion
from flask import (
@ -1374,20 +1374,27 @@ class LoLLMsWebUI(LoLLMsAPPI):
run_update_script(self.args)
def start_training(self):
data = request.get_json()
ASCIIColors.info(f"--- Trainging of model {data['model_name']} requested ---")
ASCIIColors.info(f"Cleaning memory:")
fn = self.binding.binding_folder_name
del self.binding
self.binding = None
self.model = None
for per in self.mounted_personalities:
per.model = None
gc.collect()
ASCIIColors.info(f"issuing command : python gptqlora.py --model_path {self.lollms_paths.personal_models_path/fn/data['model_name']}")
subprocess.run(["python", "gptqlora.py", "--model_path", self.lollms_paths.personal_models_path/fn/data["model_name"]],cwd=self.lollms_paths.gptqlora_path)
pass
if self.config.enable_gpu:
if not self.lollms_paths.gptqlora_path.exists():
# Clone the repository to the target path
ASCIIColors.info("No gptqlora found in your personal space.\nCloning the gptqlora repo")
subprocess.run(["git", "clone", gptqlora_repo, self.lollms_paths.gptqlora_path])
subprocess.run(["pip", "install", "-r", "requirements.txt"], cwd=self.lollms_paths.gptqlora_path)
data = request.get_json()
ASCIIColors.info(f"--- Trainging of model {data['model_name']} requested ---")
ASCIIColors.info(f"Cleaning memory:")
fn = self.binding.binding_folder_name
del self.binding
self.binding = None
self.model = None
for per in self.mounted_personalities:
per.model = None
gc.collect()
ASCIIColors.info(f"issuing command : python gptqlora.py --model_path {self.lollms_paths.personal_models_path/fn/data['model_name']}")
subprocess.run(["python", "gptqlora.py", "--model_path", self.lollms_paths.personal_models_path/fn/data["model_name"]],cwd=self.lollms_paths.gptqlora_path)
return jsonify({'status':true})
def get_lollms_version(self):
version = pkg_resources.get_distribution('lollms').version
ASCIIColors.yellow("Lollms version : "+ version)

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-c1cd9dff.js"></script>
<script type="module" crossorigin src="/assets/index-35895651.js"></script>
<link rel="stylesheet" href="/assets/index-ae0c2e02.css">
</head>
<body>

View File

@ -1,5 +1,5 @@
<template>
<div v-if="selectedModel.toLowerCase().includes('gptq')" class="container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone">
<div v-if="selectedModel!==null && selectedModel.toLowerCase().includes('gptq')" class="container overflow-y-scroll flex flex-col no-scrollbar shadow-lg p-10 pt-2 bg-bg-light-tone dark:bg-bg-dark-tone">
<form @submit.prevent="submitForm" class="">
<Card title="Training configuration" :isHorizontal="true" :disableHoverAnimation="true" :disableFocus="true">
<Card title="Model" class="" :isHorizontal="false">