Tonic commited on
Commit
8867e8a
1 Parent(s): 21d3f61

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -1,13 +1,13 @@
1
  import gradio as gr
2
  import torch
3
- from transformers import AutoTokenizer, AutoModelForCausalLM, AutoConfig
4
 
5
- # Use the base model's ID and configuration
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 = AutoModelForCausalLM.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
 
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