Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -89,6 +89,9 @@ class DocumentRAG:
|
|
89 |
|
90 |
|
91 |
def _get_embedding_model(self):
|
|
|
|
|
|
|
92 |
if self.embedding_choice == "OpenAI":
|
93 |
return OpenAIEmbeddings(api_key=self.api_key)
|
94 |
else:
|
@@ -100,10 +103,6 @@ class DocumentRAG:
|
|
100 |
|
101 |
|
102 |
|
103 |
-
if not self.api_key:
|
104 |
-
raise ValueError("API Key not found. Make sure to set the 'OPENAI_API_KEY' environment variable.")
|
105 |
-
|
106 |
-
|
107 |
|
108 |
def process_documents(self, uploaded_files):
|
109 |
"""Process uploaded files by saving them temporarily and extracting content."""
|
|
|
89 |
|
90 |
|
91 |
def _get_embedding_model(self):
|
92 |
+
if not self.api_key:
|
93 |
+
raise ValueError("API Key not found. Make sure to set the 'OPENAI_API_KEY' environment variable.")
|
94 |
+
|
95 |
if self.embedding_choice == "OpenAI":
|
96 |
return OpenAIEmbeddings(api_key=self.api_key)
|
97 |
else:
|
|
|
103 |
|
104 |
|
105 |
|
|
|
|
|
|
|
|
|
106 |
|
107 |
def process_documents(self, uploaded_files):
|
108 |
"""Process uploaded files by saving them temporarily and extracting content."""
|