mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-19 04:17:52 +00:00
upgraded install
This commit is contained in:
parent
c1edfa79e8
commit
ed9e51597d
@ -153,18 +153,6 @@ class LoLLMsAPPI(LollmsApplication):
|
|||||||
def install_model(data):
|
def install_model(data):
|
||||||
room_id = request.sid
|
room_id = request.sid
|
||||||
|
|
||||||
def get_file_size(url):
|
|
||||||
# Send a HEAD request to retrieve file metadata
|
|
||||||
response = urllib.request.urlopen(url)
|
|
||||||
|
|
||||||
# Extract the Content-Length header value
|
|
||||||
file_size = response.headers.get('Content-Length')
|
|
||||||
|
|
||||||
# Convert the file size to integer
|
|
||||||
if file_size:
|
|
||||||
file_size = int(file_size)
|
|
||||||
|
|
||||||
return file_size
|
|
||||||
|
|
||||||
def install_model_():
|
def install_model_():
|
||||||
print("Install model triggered")
|
print("Install model triggered")
|
||||||
@ -182,7 +170,7 @@ class LoLLMsAPPI(LollmsApplication):
|
|||||||
signature = f"{model_name}_{binding_folder}_{model_url}"
|
signature = f"{model_name}_{binding_folder}_{model_url}"
|
||||||
self.download_infos[signature]={
|
self.download_infos[signature]={
|
||||||
"start_time":datetime.now(),
|
"start_time":datetime.now(),
|
||||||
"total_size":get_file_size(model_path),
|
"total_size":self.binding.get_file_size(model_path),
|
||||||
"downloaded_size":0,
|
"downloaded_size":0,
|
||||||
"progress":0,
|
"progress":0,
|
||||||
"speed":0,
|
"speed":0,
|
||||||
|
Loading…
Reference in New Issue
Block a user