Update app.py

Redirect PosixPath to WindowsPath on Windows.
This commit is contained in:
fernvenue
2023-02-05 21:24:01 +08:00
committed by GitHub
parent 6d249c78ff
commit 1104471b58

View File

@@ -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()