lucas-w commited on
Commit
e1452b8
β€’
1 Parent(s): 28d9ec7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -9,6 +9,13 @@ demo = gr.ChatInterface(mental_chat)
9
  demo.launch()
10
  """
11
 
 
 
 
 
 
 
 
12
  peft_model_id = "charansr/llama2-7b-chat-hf-therapist"
13
  config = PeftConfig.from_pretrained(peft_model_id)
14
  newmodel = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
 
9
  demo.launch()
10
  """
11
 
12
+ import gradio as gr
13
+ import torch
14
+ from peft import PeftModel, PeftConfig
15
+ from transformers import AutoModelForCausalLM, AutoTokenizer
16
+
17
+ # ##### ##### ##### ##### #####
18
+
19
  peft_model_id = "charansr/llama2-7b-chat-hf-therapist"
20
  config = PeftConfig.from_pretrained(peft_model_id)
21
  newmodel = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')