This commit is contained in:
Saifeddine ALOUI 2023-06-22 23:23:56 +02:00
parent 991f472bb2
commit 7032e27d5f
2 changed files with 15 additions and 3 deletions

View File

@ -181,8 +181,20 @@ class LoLLMsAPPI():
socketio.emit('install_progress',{'status': True, 'error': ''}, room=room_id)
tpe = threading.Thread(target=install_model_, args=())
tpe.start()
@socketio.on('upload_file')
def upload_file(data):
file = data['file']
filename = file.filename
save_path = self.lollms_paths.uploads_path /filename # Specify the desired folder path
try:
file.save(save_path)
# File saved successfully
socketio.emit('progress', {'progress': 100})
except Exception as e:
# Error occurred while saving the file
socketio.emit('progress', {'error': str(e)})
@socketio.on('uninstall_model')
def uninstall_model(data):
model_path = data['path']

2
app.py
View File

@ -325,7 +325,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
personalities[language_folder.name][category_folder.name] = []
for personality_folder in category_folder.iterdir():
pers = personality_folder.stem
if personality_folder.is_dir() and personality_folder.stem !='.git':
if personality_folder.is_dir() and not personality_folder.stem.startswith('.'):
personality_info = {"folder":personality_folder.stem}
config_path = personality_folder / 'config.yaml'
if not config_path.exists():