From 1104471b58d99bbb27d886794bf250ddf51edaf5 Mon Sep 17 00:00:00 2001 From: fernvenue Date: Sun, 5 Feb 2023 21:24:01 +0800 Subject: [PATCH] Update app.py Redirect PosixPath to WindowsPath on Windows. --- application/app.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/application/app.py b/application/app.py index eeb00c34..bbfc0604 100644 --- a/application/app.py +++ b/application/app.py @@ -9,6 +9,13 @@ from langchain import OpenAI from langchain.chains import VectorDBQAWithSourcesChain from langchain.prompts import PromptTemplate +# Redirect PosixPath to WindowsPath on Windows +import platform +if platform.system() == "Windows": + import pathlib + temp = pathlib.PosixPath + pathlib.PosixPath = pathlib.WindowsPath + # loading the .env file dotenv.load_dotenv()