From 1792bf11b9843dff0b2ccdf143e1cdd44f695873 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Sun, 25 Jun 2023 19:47:40 +0200 Subject: [PATCH] updated --- lollms/binding.py | 32 ++++++++++++++++++++++++++++++++ lollms/configs/config.yaml | 2 +- setup.py | 2 +- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/lollms/binding.py b/lollms/binding.py index 096d3f7..3cf0333 100644 --- a/lollms/binding.py +++ b/lollms/binding.py @@ -12,6 +12,10 @@ from typing import Callable from lollms.paths import LollmsPaths from lollms.helpers import ASCIIColors +import tempfile +import requests +import shutil +import os import yaml from tqdm import tqdm import importlib @@ -59,6 +63,34 @@ class LLMBinding: self.models_folder = config.lollms_paths.personal_models_path / self.binding_folder_name self.models_folder.mkdir(parents=True, exist_ok=True) + + def download_and_install_wheel(self, url): + # Create a temporary directory + temp_dir = tempfile.mkdtemp() + + try: + # Download the wheel file + response = requests.get(url) + if response.status_code == 200: + # Save the downloaded file to the temporary directory + wheel_path = os.path.join(temp_dir, 'package.whl') + with open(wheel_path, 'wb') as file: + file.write(response.content) + + # Install the wheel file using pip + subprocess.check_call(['pip', 'install', wheel_path]) + + # Clean up the temporary directory + shutil.rmtree(temp_dir) + print('Installation completed successfully.') + else: + print('Failed to download the file.') + + except Exception as e: + print('An error occurred during installation:', str(e)) + shutil.rmtree(temp_dir) + + def build_model(self): """ Build the model. diff --git a/lollms/configs/config.yaml b/lollms/configs/config.yaml index f41777c..4c32343 100644 --- a/lollms/configs/config.yaml +++ b/lollms/configs/config.yaml @@ -1,6 +1,6 @@ # =================== Lord Of Large Language Models Configuration file =========================== version: 6 -binding_name: c_transformers +binding_name: null model_name: null # Host information diff --git a/setup.py b/setup.py index 8ec795e..57e3115 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ def get_all_files(path): setuptools.setup( name="lollms", - version="2.0.25", + version="2.0.26", author="Saifeddine ALOUI", author_email="aloui.saifeddine@gmail.com", description="A python library for AI personality definition",