Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,16 @@ from langchain.text_splitter import CharacterTextSplitter
|
|
| 7 |
from langchain.embeddings import OpenAIEmbeddings
|
| 8 |
from langchain.vectorstores import Chroma
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
def qa_system(pdf_file, openai_key, prompt, chain_type, k):
|
| 11 |
os.environ["OPENAI_API_KEY"] = openai_key
|
| 12 |
|
|
|
|
| 7 |
from langchain.embeddings import OpenAIEmbeddings
|
| 8 |
from langchain.vectorstores import Chroma
|
| 9 |
|
| 10 |
+
|
| 11 |
+
# Set the path of your new directory
|
| 12 |
+
dir_path = "/docs"
|
| 13 |
+
|
| 14 |
+
# Create the directory using the os module
|
| 15 |
+
os.makedirs(dir_path, exist_ok=True)
|
| 16 |
+
|
| 17 |
+
# Print a confirmation message
|
| 18 |
+
print(f"New directory created at {dir_path}")
|
| 19 |
+
|
| 20 |
def qa_system(pdf_file, openai_key, prompt, chain_type, k):
|
| 21 |
os.environ["OPENAI_API_KEY"] = openai_key
|
| 22 |
|