Added stuff

This commit is contained in:
Saifeddine ALOUI 2023-06-06 20:43:38 +02:00
parent 571cd8576b
commit b4694fee2c
2 changed files with 11 additions and 2 deletions

3
.gitignore vendored
View File

@ -181,3 +181,6 @@ test.http
shared/*
!shared/.keep
uploads

6
app.py
View File

@ -84,6 +84,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
# =========================================================================================
# Endpoints
# =========================================================================================
self.add_endpoint("/send_file", "send_file", self.send_file, methods=["POST"])
self.add_endpoint(
@ -646,6 +647,11 @@ class LoLLMsWebUI(LoLLMsAPPI):
self.process.cancel_generation()
return jsonify({"status": "ok"})
def send_file(self):
file = request.files['file']
Path("uploads").mkdir(exist_ok=True, parents=True)
file.save('uploads/' + file.filename)
return jsonify({"status": "ok"})
def rename(self):
data = request.get_json()