Spaces:
Running
Running
Update rag_pipeline.py
Browse files- rag_pipeline.py +3 -3
rag_pipeline.py
CHANGED
|
@@ -325,7 +325,7 @@ class AgriCritiqueRAG:
|
|
| 325 |
with torch.no_grad():
|
| 326 |
outputs = self.model.generate(
|
| 327 |
**inputs,
|
| 328 |
-
max_new_tokens=
|
| 329 |
temperature=0.3
|
| 330 |
)
|
| 331 |
|
|
@@ -503,7 +503,7 @@ TASK: Provide a validated answer to the question. First briefly explain your rea
|
|
| 503 |
with torch.no_grad():
|
| 504 |
outputs = self.model.generate(
|
| 505 |
**inputs,
|
| 506 |
-
max_new_tokens=
|
| 507 |
temperature=0.5, # Balanced temperature
|
| 508 |
do_sample=True,
|
| 509 |
pad_token_id=self.tokenizer.pad_token_id,
|
|
@@ -638,7 +638,7 @@ TASK: Critique this answer. Identify any unsupported claims, hallucinations, cit
|
|
| 638 |
with torch.no_grad():
|
| 639 |
outputs = self.model.generate(
|
| 640 |
**inputs,
|
| 641 |
-
max_new_tokens=
|
| 642 |
temperature=0.3,
|
| 643 |
do_sample=True,
|
| 644 |
pad_token_id=self.tokenizer.pad_token_id,
|
|
|
|
| 325 |
with torch.no_grad():
|
| 326 |
outputs = self.model.generate(
|
| 327 |
**inputs,
|
| 328 |
+
max_new_tokens=256, # Short output
|
| 329 |
temperature=0.3
|
| 330 |
)
|
| 331 |
|
|
|
|
| 503 |
with torch.no_grad():
|
| 504 |
outputs = self.model.generate(
|
| 505 |
**inputs,
|
| 506 |
+
max_new_tokens=2048, # Increased from 256 for detail
|
| 507 |
temperature=0.5, # Balanced temperature
|
| 508 |
do_sample=True,
|
| 509 |
pad_token_id=self.tokenizer.pad_token_id,
|
|
|
|
| 638 |
with torch.no_grad():
|
| 639 |
outputs = self.model.generate(
|
| 640 |
**inputs,
|
| 641 |
+
max_new_tokens=1024,
|
| 642 |
temperature=0.3,
|
| 643 |
do_sample=True,
|
| 644 |
pad_token_id=self.tokenizer.pad_token_id,
|