Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -36,20 +36,14 @@ def load_model(model_type):
|
|
| 36 |
device = "cpu" # Force CPU usage
|
| 37 |
|
| 38 |
if model_type == "summarize":
|
| 39 |
-
|
| 40 |
-
"
|
| 41 |
cache_dir="./models",
|
| 42 |
torch_dtype=torch.float32
|
| 43 |
).to(device)
|
| 44 |
|
| 45 |
-
model = PeftModel.from_pretrained(
|
| 46 |
-
base_model,
|
| 47 |
-
"pendar02/results",
|
| 48 |
-
is_trainable=False
|
| 49 |
-
).to(device)
|
| 50 |
-
|
| 51 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 52 |
-
"
|
| 53 |
cache_dir="./models"
|
| 54 |
)
|
| 55 |
else: # question_focused
|
|
|
|
| 36 |
device = "cpu" # Force CPU usage
|
| 37 |
|
| 38 |
if model_type == "summarize":
|
| 39 |
+
model = AutoModelForSeq2SeqLM.from_pretrained(
|
| 40 |
+
"pendar02/bart-large-pubmedd",
|
| 41 |
cache_dir="./models",
|
| 42 |
torch_dtype=torch.float32
|
| 43 |
).to(device)
|
| 44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
tokenizer = AutoTokenizer.from_pretrained(
|
| 46 |
+
"pendar02/bart-large-pubmedd",
|
| 47 |
cache_dir="./models"
|
| 48 |
)
|
| 49 |
else: # question_focused
|