mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-03-11 06:54:08 +00:00
Merge remote-tracking branch 'origin/main' into lollms-patchy2
This commit is contained in:
commit
96c62d8e50
@ -172,20 +172,48 @@ class LoLLMsAPPI():
|
|||||||
print("Model install requested")
|
print("Model install requested")
|
||||||
print(f"Model path : {model_path}")
|
print(f"Model path : {model_path}")
|
||||||
|
|
||||||
|
model_name = filename
|
||||||
|
binding_folder = self.config["binding_name"]
|
||||||
|
model_url = model_path
|
||||||
if installation_path.exists():
|
if installation_path.exists():
|
||||||
print("Error: Model already exists")
|
print("Error: Model already exists")
|
||||||
socketio.emit('install_progress',{'status': False, 'error': 'model already exists'}, room=room_id)
|
socketio.emit('install_progress',{
|
||||||
|
'status': False,
|
||||||
|
'error': 'model already exists',
|
||||||
|
'model_name' : model_name,
|
||||||
|
'binding_folder' : binding_folder,
|
||||||
|
'model_url' : model_url
|
||||||
|
}, room=room_id
|
||||||
|
)
|
||||||
|
|
||||||
socketio.emit('install_progress',{'status': 'progress', 'progress': progress}, room=room_id)
|
socketio.emit('install_progress',{
|
||||||
|
'status': 'progress',
|
||||||
|
'progress': progress,
|
||||||
|
'model_name' : model_name,
|
||||||
|
'binding_folder' : binding_folder,
|
||||||
|
'model_url' : model_url
|
||||||
|
}, room=room_id)
|
||||||
|
|
||||||
def callback(progress):
|
def callback(progress):
|
||||||
socketio.emit('install_progress',{'status': 'progress', 'progress': progress}, room=room_id)
|
socketio.emit('install_progress',{
|
||||||
|
'status': 'progress',
|
||||||
|
'progress': progress,
|
||||||
|
'model_name' : model_name,
|
||||||
|
'binding_folder' : binding_folder,
|
||||||
|
'model_url' : model_url
|
||||||
|
}, room=room_id)
|
||||||
|
|
||||||
if hasattr(self.binding, "download_model"):
|
if hasattr(self.binding, "download_model"):
|
||||||
self.binding.download_model(model_path, installation_path, callback)
|
self.binding.download_model(model_path, installation_path, callback)
|
||||||
else:
|
else:
|
||||||
self.download_file(model_path, installation_path, callback)
|
self.download_file(model_path, installation_path, callback)
|
||||||
socketio.emit('install_progress',{'status': True, 'error': ''}, room=room_id)
|
socketio.emit('install_progress',{
|
||||||
|
'status': True,
|
||||||
|
'error': '',
|
||||||
|
'model_name' : model_name,
|
||||||
|
'binding_folder' : binding_folder,
|
||||||
|
'model_url' : model_url
|
||||||
|
}, room=room_id)
|
||||||
tpe = threading.Thread(target=install_model_, args=())
|
tpe = threading.Thread(target=install_model_, args=())
|
||||||
tpe.start()
|
tpe.start()
|
||||||
|
|
||||||
@ -197,10 +225,10 @@ class LoLLMsAPPI():
|
|||||||
installation_path = installation_dir / filename
|
installation_path = installation_dir / filename
|
||||||
|
|
||||||
if not installation_path.exists():
|
if not installation_path.exists():
|
||||||
socketio.emit('install_progress',{'status': False, 'error': 'The model does not exist'}, room=request.sid)
|
socketio.emit('install_progress',{'status': False, 'error': 'The model does not exist', 'url':model_path}, room=request.sid)
|
||||||
|
|
||||||
installation_path.unlink()
|
installation_path.unlink()
|
||||||
socketio.emit('install_progress',{'status': True, 'error': ''}, room=request.sid)
|
socketio.emit('install_progress',{'status': True, 'error': '', 'url':model_path}, room=request.sid)
|
||||||
|
|
||||||
|
|
||||||
@socketio.on('upload_file')
|
@socketio.on('upload_file')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user