mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-29 15:44:12 +00:00
Added serving personality assets
This commit is contained in:
parent
af53cf395a
commit
f7ff5a777d
9
app.py
9
app.py
@ -99,6 +99,8 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
|
||||
self.add_endpoint("/", "", self.index, methods=["GET"])
|
||||
self.add_endpoint("/<path:filename>", "serve_static", self.serve_static, methods=["GET"])
|
||||
self.add_endpoint("/personalities/<path:filename>", "serve_personalities", self.serve_personalities, methods=["GET"])
|
||||
|
||||
|
||||
self.add_endpoint("/export_discussion", "export_discussion", self.export_discussion, methods=["GET"])
|
||||
self.add_endpoint("/export", "export", self.export, methods=["GET"])
|
||||
@ -368,6 +370,13 @@ class Gpt4AllWebUI(GPT4AllAPI):
|
||||
fn = filename.split("/")[-1]
|
||||
return send_from_directory(path, fn)
|
||||
|
||||
def serve_personalities(self, filename):
|
||||
root_dir = os.getcwd()
|
||||
path = os.path.join(root_dir, 'personalities/')+"/".join(filename.split("/")[:-1])
|
||||
|
||||
fn = filename.split("/")[-1]
|
||||
return send_from_directory(path, fn)
|
||||
|
||||
|
||||
def format_message(self, message):
|
||||
# Look for a code block within the message
|
||||
|
Loading…
x
Reference in New Issue
Block a user