mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-21 05:13:10 +00:00
Merge branch 'main' into lollms-patchy2
This commit is contained in:
commit
8abfb250f6
@ -657,7 +657,21 @@ class LoLLMsAPPI():
|
|||||||
self._current_ai_message_id=id
|
self._current_ai_message_id=id
|
||||||
self._message_id = id
|
self._message_id = id
|
||||||
|
|
||||||
|
def load_binding(self):
|
||||||
|
try:
|
||||||
|
print("update_settings : New binding selected")
|
||||||
|
if hasattr(self,"process") and self.process.ready:
|
||||||
|
result = self.process.set_config(self.config)
|
||||||
|
if result["status"]:
|
||||||
|
ASCIIColors.success("OK")
|
||||||
|
else:
|
||||||
|
ASCIIColors.error("NOK")
|
||||||
|
except Exception as ex:
|
||||||
|
ASCIIColors.error(f"Couldn't load model.Process returned exception : {ex}")
|
||||||
|
ASCIIColors.error(f"Binding returned this exception : {ex}")
|
||||||
|
ASCIIColors.error(f"{self.config.get_model_path_infos()}")
|
||||||
|
print("Please select a valid model or install a new one from a url")
|
||||||
|
self.menu.select_model()
|
||||||
def load_model(self):
|
def load_model(self):
|
||||||
try:
|
try:
|
||||||
print("update_settings : New model selected")
|
print("update_settings : New model selected")
|
||||||
@ -678,7 +692,7 @@ class LoLLMsAPPI():
|
|||||||
def load_personality(self):
|
def load_personality(self):
|
||||||
try:
|
try:
|
||||||
print("update_settings : New personality selected")
|
print("update_settings : New personality selected")
|
||||||
if hasattr(self,"process"):
|
if hasattr(self,"process") and self.process.ready:
|
||||||
result = self.process.set_config(self.config)
|
result = self.process.set_config(self.config)
|
||||||
if result["status"]:
|
if result["status"]:
|
||||||
ASCIIColors.success("OK")
|
ASCIIColors.success("OK")
|
||||||
|
10
api/db.py
10
api/db.py
@ -314,7 +314,7 @@ class Discussion:
|
|||||||
self.current_message_created_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
self.current_message_created_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
self.current_message_finished_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
self.current_message_finished_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
def add_message(self, sender, content, message_type=0, rank=0, parent=0, binding="", model ="", personality="", created_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S'), finished_generating_at=datetime.now().strftime('%Y-%m-%d %H:%M:%S')):
|
def add_message(self, sender, content, message_type=0, rank=0, parent=0, binding="", model ="", personality="", created_at=None, finished_generating_at=None):
|
||||||
"""Adds a new message to the discussion
|
"""Adds a new message to the discussion
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -324,6 +324,11 @@ class Discussion:
|
|||||||
Returns:
|
Returns:
|
||||||
int: The added message id
|
int: The added message id
|
||||||
"""
|
"""
|
||||||
|
if created_at is None:
|
||||||
|
created_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
|
|
||||||
|
if finished_generating_at is None:
|
||||||
|
finished_generating_at = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
self.current_message_binding = binding
|
self.current_message_binding = binding
|
||||||
self.current_message_model = model
|
self.current_message_model = model
|
||||||
self.current_message_personality = personality
|
self.current_message_personality = personality
|
||||||
@ -381,13 +386,14 @@ class Discussion:
|
|||||||
"finished_generating_at": row[10]
|
"finished_generating_at": row[10]
|
||||||
} for row in rows]
|
} for row in rows]
|
||||||
|
|
||||||
def update_message(self, message_id, new_content, current_date_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')):
|
def update_message(self, message_id, new_content):
|
||||||
"""Updates the content of a message
|
"""Updates the content of a message
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
message_id (int): The id of the message to be changed
|
message_id (int): The id of the message to be changed
|
||||||
new_content (str): The nex message content
|
new_content (str): The nex message content
|
||||||
"""
|
"""
|
||||||
|
current_date_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
|
||||||
self.current_message_finished_generating_at = current_date_time
|
self.current_message_finished_generating_at = current_date_time
|
||||||
|
|
||||||
# print(f"{current_date_time}")
|
# print(f"{current_date_time}")
|
||||||
|
11
app.py
11
app.py
@ -311,9 +311,16 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
|||||||
for personality_folder in category_folder.iterdir():
|
for personality_folder in category_folder.iterdir():
|
||||||
pers = personality_folder.stem
|
pers = personality_folder.stem
|
||||||
if personality_folder.is_dir():
|
if personality_folder.is_dir():
|
||||||
|
personality_info = {"folder":personality_folder.stem}
|
||||||
|
config_path = personality_folder / 'config.yaml'
|
||||||
|
if not config_path.exists():
|
||||||
|
try:
|
||||||
|
config_path.parent.rmdir()
|
||||||
|
ASCIIColors.warning(f"Deleted useless personality: {config_path.parent}")
|
||||||
|
except:
|
||||||
|
ASCIIColors.warning(f"Couldn't delete personality")
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
personality_info = {"folder":personality_folder.stem}
|
|
||||||
config_path = personality_folder / 'config.yaml'
|
|
||||||
with open(config_path) as config_file:
|
with open(config_path) as config_file:
|
||||||
config_data = yaml.load(config_file, Loader=yaml.FullLoader)
|
config_data = yaml.load(config_file, Loader=yaml.FullLoader)
|
||||||
personality_info['name'] = config_data.get('name',"No Name")
|
personality_info['name'] = config_data.get('name',"No Name")
|
||||||
|
98
web/dist/assets/index-34e61592.js
vendored
Normal file
98
web/dist/assets/index-34e61592.js
vendored
Normal file
File diff suppressed because one or more lines are too long
98
web/dist/assets/index-47b6b817.js
vendored
98
web/dist/assets/index-47b6b817.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
web/dist/index.html
vendored
4
web/dist/index.html
vendored
@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<title>LoLLMS WebUI - Welcome</title>
|
<title>LoLLMS WebUI - Welcome</title>
|
||||||
<script type="module" crossorigin src="/assets/index-47b6b817.js"></script>
|
<script type="module" crossorigin src="/assets/index-34e61592.js"></script>
|
||||||
<link rel="stylesheet" href="/assets/index-1760585e.css">
|
<link rel="stylesheet" href="/assets/index-91dd80ad.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user