Spaces:
Running
Running
Commit
•
be6ea65
1
Parent(s):
4399fa1
API KEY in secret environment (#3)
Browse files- API KEY in secret environment (b8d12f671ce7d2b01a986f53ea213fb86e88f863)
Co-authored-by: Dupland <[email protected]>
- rag_module.py +2 -1
rag_module.py
CHANGED
@@ -24,10 +24,11 @@ from dotenv import load_dotenv
|
|
24 |
load_dotenv()
|
25 |
from collections import defaultdict
|
26 |
|
|
|
27 |
|
28 |
class RagModule():
|
29 |
def __init__(self):
|
30 |
-
self.mistral_api_key =
|
31 |
self.model_name_embedding = "mistral-embed"
|
32 |
self.embedding_model = MistralAIEmbeddings(model=self.model_name_embedding, mistral_api_key=self.mistral_api_key)
|
33 |
self.chunk_size = 1000
|
|
|
24 |
load_dotenv()
|
25 |
from collections import defaultdict
|
26 |
|
27 |
+
api_key = os.environ.get("MISTRAL_API_KEY")
|
28 |
|
29 |
class RagModule():
|
30 |
def __init__(self):
|
31 |
+
self.mistral_api_key = api_key
|
32 |
self.model_name_embedding = "mistral-embed"
|
33 |
self.embedding_model = MistralAIEmbeddings(model=self.model_name_embedding, mistral_api_key=self.mistral_api_key)
|
34 |
self.chunk_size = 1000
|