Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
-
from transformers import AutoTokenizer,
|
4 |
|
5 |
-
# Use the base model's ID
|
6 |
base_model_id = "mistralai/Mistral-7B-v0.1"
|
7 |
config = AutoConfig.from_pretrained(base_model_id)
|
8 |
|
9 |
# Load the fine-tuned model "Tonic/mistralmed"
|
10 |
-
model =
|
11 |
|
12 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
|
13 |
tokenizer.pad_token = tokenizer.eos_token
|
|
|
1 |
import gradio as gr
|
2 |
import torch
|
3 |
+
from transformers import AutoTokenizer, AutoModel, AutoConfig
|
4 |
|
5 |
+
# Use the base model's ID
|
6 |
base_model_id = "mistralai/Mistral-7B-v0.1"
|
7 |
config = AutoConfig.from_pretrained(base_model_id)
|
8 |
|
9 |
# Load the fine-tuned model "Tonic/mistralmed"
|
10 |
+
model = AutoModel.from_pretrained("Tonic/mistralmed", config=config)
|
11 |
|
12 |
tokenizer = AutoTokenizer.from_pretrained(base_model_id, trust_remote_code=True)
|
13 |
tokenizer.pad_token = tokenizer.eos_token
|