Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,19 +4,15 @@ from transformers import AutoModelForCausalLM
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
config = PeftConfig.from_pretrained("Tonic/mistralmed")
|
10 |
-
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|
11 |
-
model = PeftModel.from_pretrained(model, "Tonic/mistralmed")
|
12 |
-
|
13 |
# Use the base model's ID
|
14 |
base_model_id = "mistralai/Mistral-7B-v0.1"
|
15 |
model_directory = "Tonic/mistralmed"
|
16 |
|
17 |
-
#
|
18 |
-
model = AutoModelForCausalLM.from_pretrained(model_directory, token="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")
|
19 |
|
|
|
|
|
|
|
20 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
|
21 |
tokenizer.pad_token = tokenizer.eos_token
|
22 |
tokenizer.padding_side = 'left'
|
|
|
4 |
|
5 |
import gradio as gr
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# Use the base model's ID
|
8 |
base_model_id = "mistralai/Mistral-7B-v0.1"
|
9 |
model_directory = "Tonic/mistralmed"
|
10 |
|
11 |
+
#instantiate the Models
|
|
|
12 |
|
13 |
+
config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
|
14 |
+
model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|
15 |
+
model = PeftModel.from_pretrained(model, "Tonic/mistralmed", token="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")
|
16 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
|
17 |
tokenizer.pad_token = tokenizer.eos_token
|
18 |
tokenizer.padding_side = 'left'
|