Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -323,8 +323,7 @@ class OptimizedGazaRAGSystem:
|
|
323 |
self.generation_pipeline = pipeline(
|
324 |
"text2text-generation", # ✅ correct pipeline for T5
|
325 |
model=self.llm,
|
326 |
-
tokenizer=self.tokenizer
|
327 |
-
return_full_text=False
|
328 |
)
|
329 |
logger.info("✅ FLAN-T5 model loaded successfully")
|
330 |
except Exception as e:
|
@@ -497,7 +496,7 @@ RESPONSE (provide practical, Gaza-appropriate medical guidance):"""
|
|
497 |
|
498 |
try:
|
499 |
# Tokenize and move to correct device
|
500 |
-
inputs = self.tokenizer(prompt, return_tensors="pt", truncation=True, max_length=
|
501 |
if hasattr(self.llm, 'device'):
|
502 |
inputs = inputs.to(self.llm.device)
|
503 |
|
|
|
323 |
self.generation_pipeline = pipeline(
|
324 |
"text2text-generation", # ✅ correct pipeline for T5
|
325 |
model=self.llm,
|
326 |
+
tokenizer=self.tokenizer
|
|
|
327 |
)
|
328 |
logger.info("✅ FLAN-T5 model loaded successfully")
|
329 |
except Exception as e:
|
|
|
496 |
|
497 |
try:
|
498 |
# Tokenize and move to correct device
|
499 |
+
inputs = self.tokenizer(prompt, return_tensors="pt", truncation=True, max_length=512)
|
500 |
if hasattr(self.llm, 'device'):
|
501 |
inputs = inputs.to(self.llm.device)
|
502 |
|