Spaces:
Build error
Build error
Commit
·
2af629b
1
Parent(s):
f4659b5
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,6 @@ from io import BytesIO
|
|
| 9 |
from langchain.document_loaders import PyPDFLoader
|
| 10 |
import gradio as gr
|
| 11 |
import chromadb
|
| 12 |
-
from dotenv import load_dotenv
|
| 13 |
from constants import CHROMA_SETTINGS
|
| 14 |
from io import BytesIO
|
| 15 |
import gradio as gr
|
|
@@ -32,14 +31,10 @@ device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
|
| 32 |
llm= ChatGooglePalm()
|
| 33 |
#llm= HuggingFacePipeline.from_model_id(model_id=local_llm, task='text-generation', device=0, pipeline_kwargs={"max_new_tokens": 1000})
|
| 34 |
|
| 35 |
-
embeddings_model_name = os.environ.get('EMBEDDINGS_MODEL_NAME')
|
| 36 |
persist_directory = os.environ.get('PERSIST_DIRECTORY')
|
| 37 |
target_source_chunks = int(os.environ.get('TARGET_SOURCE_CHUNKS',4))
|
| 38 |
google_api_key= os.environ.get('GOOGLE_API_KEY')
|
| 39 |
-
|
| 40 |
-
print("Could not load .env file or it is empty. Please check if it exists and is readable.")
|
| 41 |
-
exit(1)
|
| 42 |
-
|
| 43 |
print("Loading embeddings model...")
|
| 44 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
| 45 |
#embeddings= pipeline("feature-extraction", model="WhereIsAI/UAE-Large-V1")
|
|
|
|
| 9 |
from langchain.document_loaders import PyPDFLoader
|
| 10 |
import gradio as gr
|
| 11 |
import chromadb
|
|
|
|
| 12 |
from constants import CHROMA_SETTINGS
|
| 13 |
from io import BytesIO
|
| 14 |
import gradio as gr
|
|
|
|
| 31 |
llm= ChatGooglePalm()
|
| 32 |
#llm= HuggingFacePipeline.from_model_id(model_id=local_llm, task='text-generation', device=0, pipeline_kwargs={"max_new_tokens": 1000})
|
| 33 |
|
|
|
|
| 34 |
persist_directory = os.environ.get('PERSIST_DIRECTORY')
|
| 35 |
target_source_chunks = int(os.environ.get('TARGET_SOURCE_CHUNKS',4))
|
| 36 |
google_api_key= os.environ.get('GOOGLE_API_KEY')
|
| 37 |
+
|
|
|
|
|
|
|
|
|
|
| 38 |
print("Loading embeddings model...")
|
| 39 |
embeddings = GoogleGenerativeAIEmbeddings(model="models/embedding-001")
|
| 40 |
#embeddings= pipeline("feature-extraction", model="WhereIsAI/UAE-Large-V1")
|