Spaces:
Sleeping
Sleeping
Update src/RAGSample.py
Browse files- src/RAGSample.py +5 -2
src/RAGSample.py
CHANGED
@@ -378,7 +378,6 @@ def setup_rag_chain() -> Runnable:
|
|
378 |
- For serious symptoms or concerns, always recommend consulting healthcare professionals
|
379 |
- Keep responses concise (2-4 sentences maximum)
|
380 |
- This information is for educational purposes only
|
381 |
-
|
382 |
Question: {question}
|
383 |
Documents: {documents}
|
384 |
Answer:
|
@@ -389,13 +388,17 @@ Answer:
|
|
389 |
# Initialize a local Hugging Face model
|
390 |
hf_pipeline = pipeline(
|
391 |
"text-generation",
|
392 |
-
model="
|
|
|
393 |
max_new_tokens=150,
|
|
|
394 |
temperature=0.3,
|
395 |
device_map="auto",
|
396 |
return_full_text=False,
|
397 |
truncation=True,
|
398 |
do_sample=True,
|
|
|
|
|
399 |
)
|
400 |
|
401 |
# Wrap it in LangChain
|
|
|
378 |
- For serious symptoms or concerns, always recommend consulting healthcare professionals
|
379 |
- Keep responses concise (2-4 sentences maximum)
|
380 |
- This information is for educational purposes only
|
|
|
381 |
Question: {question}
|
382 |
Documents: {documents}
|
383 |
Answer:
|
|
|
388 |
# Initialize a local Hugging Face model
|
389 |
hf_pipeline = pipeline(
|
390 |
"text-generation",
|
391 |
+
model="m42-health/Llama3-Med42-8B",
|
392 |
+
tokenizer="m42-health/Llama3-Med42-8B",
|
393 |
max_new_tokens=150,
|
394 |
+
max_length=2048, # Llama3 supports longer context
|
395 |
temperature=0.3,
|
396 |
device_map="auto",
|
397 |
return_full_text=False,
|
398 |
truncation=True,
|
399 |
do_sample=True,
|
400 |
+
pad_token_id=128001, # Llama3 pad token
|
401 |
+
eos_token_id=128009, # Llama3 EOS token
|
402 |
)
|
403 |
|
404 |
# Wrap it in LangChain
|