mouadenna commited on
Commit
41af6a9
1 Parent(s): c35ea6c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -12,7 +12,7 @@ import os
12
 
13
  import torch
14
  from peft import PeftModel, PeftConfig
15
- from transformers import AutoModelForCausalLM,AutoTokenizer
16
 
17
  import joblib
18
  from deployML import predd
@@ -21,15 +21,15 @@ import time
21
 
22
  #load the chatbot
23
 
24
- peft_model_id = "mouadenna/MedAlpaca-lora0"
25
 
26
- config = PeftConfig.from_pretrained(peft_model_id)
27
-
28
- model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
29
- tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
 
 
30
 
31
- # Load the Lora model
32
- model = PeftModel.from_pretrained(model, peft_model_id)
33
 
34
 
35
  #load the first interface
 
12
 
13
  import torch
14
  from peft import PeftModel, PeftConfig
15
+ from transformers import AutoModelForCausalLM,AutoTokenizer, LlamaForCausalLM
16
 
17
  import joblib
18
  from deployML import predd
 
21
 
22
  #load the chatbot
23
 
 
24
 
25
+ model = LlamaForCausalLM.from_pretrained(
26
+ "medalpaca/medalpaca-7b",
27
+ return_dict=True,
28
+ load_in_8bit=True,
29
+ device_map="auto",
30
+ )
31
 
32
+ tokenizer = AutoTokenizer.from_pretrained("medalpaca/medalpaca-7b")
 
33
 
34
 
35
  #load the first interface