Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: Load default documentation #855

Open
2 tasks done
xamul-it opened this issue Feb 15, 2024 · 0 comments
Open
2 tasks done

🐛 Bug Report: Load default documentation #855

xamul-it opened this issue Feb 15, 2024 · 0 comments

Comments

@xamul-it
Copy link

📜 Description

When the system is starterd using containers the default documentation/embeddings are downloaded in the wrong folder of the conatianer.
The documentation get downloaded in /app/vectors instead of /app/application/vectors

Here is just a quick workaround, but not a fix. Documentation should be written in the folder defined by settings.

@user.route("/api/docs_check", methods=["POST"])
def check_docs():
# check if docs exist in a vectorstore folder
data = request.get_json()
# split docs on / and take first part
if data["docs"].split("/")[0] == "local":
return {"status": "exists"}
vectorstore = "vectors/" + data["docs"]
base_path = "https://raw.githubusercontent.com/arc53/DocsHUB/main/"
if os.path.exists("application/" + vectorstore) or data["docs"] == "default":
print(f"{vectorstore}")
return {"status": "exists"}
else:
r = requests.get(base_path + vectorstore + "index.faiss")

    if r.status_code != 200:
        return {"status": "null"}
    else:
        vectorstore2 = "**application**/" + vectorstore #should be set by using settings
        if not os.path.exists(vectorstore2):
            os.makedirs(vectorstore2)
        with open(vectorstore2 + "index.faiss", "wb") as f:
            f.write(r.content)

        # download the store
        r = requests.get(base_path + vectorstore + "index.pkl")
        with open(vectorstore2 + "index.pkl", "wb") as f:
            f.write(r.content)

    return {"status": "loaded"}

👟 Reproduction steps

  1. Use a clean environment
  2. Download from git
  3. Configure .env with your settings
  4. Start with containers
  5. Call check_docs with a default existing embedding "python/pandas/1.5.3/openai_text-embedding-ada-002/"

👍 Expected behavior

Browse inside the container.
Expected: documentation has been downloaded in /app/application/vectors

👎 Actual Behavior with Screenshots

Happens: You see documentation in /app/vectors
Capture

💻 Operating system

Linux

What browsers are you seeing the problem on?

No response

🤖 What development environment are you experiencing this bug on?

Docker

🔒 Did you set the correct environment variables in the right path? List the environment variable names (not values please!)

No response

📃 Provide any additional context for the Bug.

No response

📖 Relevant log output

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🔗 Are you willing to submit PR?

Yes, I am willing to submit a PR!

🧑‍⚖️ Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant