Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -11,12 +11,15 @@ from langchain_community.document_loaders import UnstructuredMarkdownLoader
|
|
| 11 |
from langchain_text_splitters import MarkdownHeaderTextSplitter
|
| 12 |
from langchain_community.vectorstores import Chroma
|
| 13 |
from langchain.chains.combine_documents import create_stuff_documents_chain
|
| 14 |
-
from langchain.chains
|
| 15 |
from langchain_core.prompts import PromptTemplate
|
| 16 |
from huggingface_hub import InferenceClient
|
| 17 |
from langchain_core.language_models.llms import LLM
|
| 18 |
from typing import Optional, List, Any
|
| 19 |
|
|
|
|
|
|
|
|
|
|
| 20 |
# Load environment variables first
|
| 21 |
# load_dotenv() # This will need commented out on HuggingFace. To run the code yourself on your device, keep this and comment out the api_key var
|
| 22 |
# via os.getenv
|
|
|
|
| 11 |
from langchain_text_splitters import MarkdownHeaderTextSplitter
|
| 12 |
from langchain_community.vectorstores import Chroma
|
| 13 |
from langchain.chains.combine_documents import create_stuff_documents_chain
|
| 14 |
+
from langchain.chains import create_retrieval_chain
|
| 15 |
from langchain_core.prompts import PromptTemplate
|
| 16 |
from huggingface_hub import InferenceClient
|
| 17 |
from langchain_core.language_models.llms import LLM
|
| 18 |
from typing import Optional, List, Any
|
| 19 |
|
| 20 |
+
# Fix OpenMP environment variable issue
|
| 21 |
+
os.environ["OMP_NUM_THREADS"] = "1"
|
| 22 |
+
|
| 23 |
# Load environment variables first
|
| 24 |
# load_dotenv() # This will need commented out on HuggingFace. To run the code yourself on your device, keep this and comment out the api_key var
|
| 25 |
# via os.getenv
|