Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,16 @@ from sentence_transformers import SentenceTransformer
|
|
7 |
#Konstanten
|
8 |
HF_READ = os.getenv("HF_READ")
|
9 |
ANTI_BOT_PW = os.getenv("CORRECT_VALIDATE")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
# Initialisierung des Sentence-BERT Modells für die Embeddings
|
12 |
embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
|
|
7 |
#Konstanten
|
8 |
HF_READ = os.getenv("HF_READ")
|
9 |
ANTI_BOT_PW = os.getenv("CORRECT_VALIDATE")
|
10 |
+
# Setzen des Hugging Face Tokens als Umgebungsvariable
|
11 |
+
os.environ["HUGGINGFACEHUB_API_TOKEN"] = HF_READ
|
12 |
+
|
13 |
+
# Initialisierung des Sentence-BERT Modells für die Embeddings
|
14 |
+
embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|
15 |
+
|
16 |
+
# Initialisierung von Tokenizer und RAG Modell
|
17 |
+
tokenizer = RagTokenizer.from_pretrained("facebook/rag-sequence-nq", use_auth_token=True)
|
18 |
+
model = RagSequenceForGeneration.from_pretrained("facebook/rag-sequence-nq", use_auth_token=True)
|
19 |
+
|
20 |
|
21 |
# Initialisierung des Sentence-BERT Modells für die Embeddings
|
22 |
embedding_model = SentenceTransformer('all-MiniLM-L6-v2')
|