Tonic commited on
Commit
4c79a74
•
1 Parent(s): 5189ab0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -1,6 +1,15 @@
1
  from transformers import AutoTokenizer, AutoModelForCausalLM
 
 
 
2
  import gradio as gr
3
 
 
 
 
 
 
 
4
  # Use the base model's ID
5
  base_model_id = "mistralai/Mistral-7B-v0.1"
6
  model_directory = "Tonic/mistralmed"
 
1
  from transformers import AutoTokenizer, AutoModelForCausalLM
2
+ from peft import PeftModel, PeftConfig
3
+ 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"