Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,10 +8,17 @@ base_model_id = "mistralai/Mistral-7B-v0.1"
|
|
| 8 |
model_directory = "Tonic/mistralmed"
|
| 9 |
|
| 10 |
# Instantiate the Models
|
| 11 |
-
tokenizer = AutoTokenizer.from_pretrained(
|
| 12 |
tokenizer.pad_token = tokenizer.eos_token
|
| 13 |
tokenizer.padding_side = 'left'
|
| 14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
# Load the PEFT model
|
| 16 |
peft_config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
|
| 17 |
peft_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|
|
|
|
| 8 |
model_directory = "Tonic/mistralmed"
|
| 9 |
|
| 10 |
# Instantiate the Models
|
| 11 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1", trust_remote_code=True)
|
| 12 |
tokenizer.pad_token = tokenizer.eos_token
|
| 13 |
tokenizer.padding_side = 'left'
|
| 14 |
|
| 15 |
+
|
| 16 |
+
# Specify the configuration class for the model
|
| 17 |
+
model_config = AutoConfig.from_pretrained(base_model_id)
|
| 18 |
+
|
| 19 |
+
# Load the PEFT model with the specified configuration
|
| 20 |
+
peft_model = AutoModelForCausalLM.from_pretrained(base_model_id, config=model_config)
|
| 21 |
+
|
| 22 |
# Load the PEFT model
|
| 23 |
peft_config = PeftConfig.from_pretrained("Tonic/mistralmed", token="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")
|
| 24 |
peft_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|