Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ import os
|
|
12 |
|
13 |
import torch
|
14 |
from peft import PeftModel, PeftConfig
|
15 |
-
from transformers import AutoModelForCausalLM,AutoTokenizer
|
16 |
|
17 |
import joblib
|
18 |
from deployML import predd
|
@@ -21,15 +21,15 @@ import time
|
|
21 |
|
22 |
#load the chatbot
|
23 |
|
24 |
-
peft_model_id = "mouadenna/MedAlpaca-lora0"
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
30 |
|
31 |
-
|
32 |
-
model = PeftModel.from_pretrained(model, peft_model_id)
|
33 |
|
34 |
|
35 |
#load the first interface
|
|
|
12 |
|
13 |
import torch
|
14 |
from peft import PeftModel, PeftConfig
|
15 |
+
from transformers import AutoModelForCausalLM,AutoTokenizer, LlamaForCausalLM
|
16 |
|
17 |
import joblib
|
18 |
from deployML import predd
|
|
|
21 |
|
22 |
#load the chatbot
|
23 |
|
|
|
24 |
|
25 |
+
model = LlamaForCausalLM.from_pretrained(
|
26 |
+
"medalpaca/medalpaca-7b",
|
27 |
+
return_dict=True,
|
28 |
+
load_in_8bit=True,
|
29 |
+
device_map="auto",
|
30 |
+
)
|
31 |
|
32 |
+
tokenizer = AutoTokenizer.from_pretrained("medalpaca/medalpaca-7b")
|
|
|
33 |
|
34 |
|
35 |
#load the first interface
|