Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1 |
-
from transformers import AutoConfig, AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM
|
2 |
from peft import PeftModel, PeftConfig
|
3 |
import torch
|
4 |
import gradio as gr
|
5 |
-
|
|
|
6 |
# Use the base model's ID
|
7 |
base_model_id = "mistralai/Mistral-7B-v0.1"
|
8 |
model_directory = "Tonic/mistralmed"
|
@@ -21,7 +22,7 @@ tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", trust_rem
|
|
21 |
|
22 |
# Load the PEFT model
|
23 |
peft_config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
|
24 |
-
peft_model =
|
25 |
peft_model = PeftModel.from_pretrained(base_model, "Tonic/mistralmed", token="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")
|
26 |
|
27 |
class ChatBot:
|
|
|
1 |
+
from transformers import AutoConfig, AutoTokenizer, AutoModelForSeq2SeqLM, AutoModelForCausalLM, MistralForCausalLM
|
2 |
from peft import PeftModel, PeftConfig
|
3 |
import torch
|
4 |
import gradio as gr
|
5 |
+
|
6 |
+
|
7 |
# Use the base model's ID
|
8 |
base_model_id = "mistralai/Mistral-7B-v0.1"
|
9 |
model_directory = "Tonic/mistralmed"
|
|
|
22 |
|
23 |
# Load the PEFT model
|
24 |
peft_config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
|
25 |
+
peft_model = MistralForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1", trust_remote_code=True)
|
26 |
peft_model = PeftModel.from_pretrained(base_model, "Tonic/mistralmed", token="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")
|
27 |
|
28 |
class ChatBot:
|