upgraded lollms

This commit is contained in:
Saifeddine ALOUI 2023-09-02 20:37:22 +02:00
parent 7811c1302b
commit 476184c1ba
2 changed files with 17 additions and 1 deletions

View File

@ -779,3 +779,19 @@ class LOLLMSLocalizer:
return localized_string
class File_Path_Generator:
@staticmethod
def generate_unique_file_path(folder_path, file_base_name, file_extension):
folder_path = Path(folder_path)
index = 0
while True:
# Construct the full file path with the current index
file_name = f"{file_base_name}_{index}.{file_extension}"
full_file_path = folder_path / file_name
# Check if the file already exists in the folder
if not full_file_path.exists():
return full_file_path
# If the file exists, increment the index and try again
index += 1

View File

@ -26,7 +26,7 @@ def get_all_files(path):
setuptools.setup(
name="lollms",
version="5.0.2",
version="5.1.0",
author="Saifeddine ALOUI",
author_email="aloui.saifeddine@gmail.com",
description="A python library for AI personality definition",