Skip to content

Commit 0637c80

Browse files
committed
1. fixed the crash issue when loading voice chat history in non-voice mode.
1 parent 2c073ab commit 0637c80

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ailice/core/AProcessor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,12 @@ def FromJson(self, data):
255255
self.interpreter.FromJson(data['interpreter'])
256256
self.conversation.FromJson(data["conversation"])
257257
self.collection = data['collection']
258-
self.RegisterModules([m['addr'] for k,m in data["modules"].items()])
258+
for k,m in data["modules"].items():
259+
try:
260+
self.RegisterModules([m['addr']])
261+
except Exception as e:
262+
print(f"FromJson(): RegisterModules FAILED on {m['addr']}")
263+
continue
259264
self.prompt = self.promptsManager[data['agentType']](processor=self, storage=self.modules['storage']['module'], collection=self.collection, conversations=self.conversation, formatter=self.llm.formatter, outputCB=self.outputCB)
260265
if hasattr(self.prompt, "FromJson"):
261266
self.prompt.FromJson(data['prompt'])

0 commit comments

Comments
 (0)