Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,13 @@
|
|
1 |
-
from
|
|
|
2 |
import os
|
3 |
|
4 |
access_token = os.environ['HF_TOKEN']
|
5 |
|
6 |
-
|
7 |
-
model = AutoModelForCausalLM.from_pretrained("
|
|
|
|
|
8 |
|
9 |
input_text = "Write me a poem about Machine Learning."
|
10 |
input_ids = tokenizer(input_text, return_tensors="pt")
|
|
|
1 |
+
from peft import PeftModel, PeftConfig
|
2 |
+
from transformers import AutoModelForCausalLM
|
3 |
import os
|
4 |
|
5 |
access_token = os.environ['HF_TOKEN']
|
6 |
|
7 |
+
config = PeftConfig.from_pretrained("HiTZ/Mistral-7B-MedExpQA-EN")
|
8 |
+
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1", token=access_token)
|
9 |
+
model = PeftModel.from_pretrained(model, "HiTZ/Mistral-7B-MedExpQA-EN", token=access_token)
|
10 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", token=access_token)
|
11 |
|
12 |
input_text = "Write me a poem about Machine Learning."
|
13 |
input_ids = tokenizer(input_text, return_tensors="pt")
|