Skip to content

Commit

Permalink
minor fixes on deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
dartpain committed Oct 4, 2023
1 parent 94f3533 commit 8320cca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions .env-template
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
OPENAI_API_KEY=<LLM api key (for example, open ai key)>
SELF_HOSTED_MODEL=false
API_KEY=<LLM api key (for example, open ai key)>
VITE_API_STREAMING=true

#For Azure
#For Azure (you can delete it if you don't use Azure)
OPENAI_API_BASE=
OPENAI_API_VERSION=
AZURE_DEPLOYMENT_NAME=
Expand Down
9 changes: 5 additions & 4 deletions application/api/user/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,14 @@ def delete_old():
path = request.args.get("path")
dirs = path.split("/")
dirs_clean = []
for i in range(1, len(dirs)):
for i in range(0, len(dirs)):
dirs_clean.append(secure_filename(dirs[i]))
# check that path strats with indexes or vectors
if dirs[0] not in ["indexes", "vectors"]:

if dirs_clean[0] not in ["indexes", "vectors"]:
return {"status": "error"}
path_clean = "/".join(dirs)
vectors_collection.delete_one({"location": path})
path_clean = "/".join(dirs_clean)
vectors_collection.delete_one({"name": dirs_clean[-1], 'user': dirs_clean[-2]})
if settings.VECTOR_STORE == "faiss":
try:
shutil.rmtree(os.path.join(current_dir, path_clean))
Expand Down

2 comments on commit 8320cca

@vercel
Copy link

@vercel vercel bot commented on 8320cca Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs-gpt – ./frontend

docs-gpt-git-main-arc53.vercel.app
docs-gpt-arc53.vercel.app
docs-gpt-brown.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 8320cca Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nextra-docsgpt – ./docs

nextra-docsgpt-git-main-arc53.vercel.app
docs.docsgpt.co.uk
nextra-docsgpt.vercel.app
nextra-docsgpt-arc53.vercel.app

Please sign in to comment.