Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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')
|