Sanjay002 commited on
Commit
9b76599
Β·
verified Β·
1 Parent(s): 3cdb88b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -3
app.py CHANGED
@@ -3,11 +3,17 @@ import torch
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  from peft import PeftModel
5
 
6
- base_model = "ybelkada/falcon-7b-sharded-bf16"
7
  adapter_model = "Sanjay002/falcon-7b-mental-health-finetuned"
8
 
9
- tokenizer = AutoTokenizer.from_pretrained(base_model)
10
- model = AutoModelForCausalLM.from_pretrained(base_model, device_map="auto", torch_dtype=torch.float16)
 
 
 
 
 
 
11
  model = PeftModel.from_pretrained(model, adapter_model)
12
  model.eval()
13
 
 
3
  from transformers import AutoTokenizer, AutoModelForCausalLM
4
  from peft import PeftModel
5
 
6
+ base_model = "heliosbrahma/falcon-7b-sharded-bf16-finetuned-mental-health-conversational"
7
  adapter_model = "Sanjay002/falcon-7b-mental-health-finetuned"
8
 
9
+ tokenizer = AutoTokenizer.from_pretrained(base_model, trust_remote_code=True)
10
+ model = AutoModelForCausalLM.from_pretrained(
11
+ base_model,
12
+ device_map="auto",
13
+ torch_dtype=torch.bfloat16,
14
+ trust_remote_code=True
15
+ )
16
+
17
  model = PeftModel.from_pretrained(model, adapter_model)
18
  model.eval()
19