Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,17 @@ import chromadb
|
|
9 |
from datasets import load_dataset
|
10 |
# from transformers import AutoModelForCausalLM, AutoTokenizer
|
11 |
import gradio as gr
|
12 |
-
from
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
|
@@ -87,8 +97,7 @@ vector_store.populate_vectors(dataset=None)
|
|
87 |
# tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
88 |
# model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
89 |
|
90 |
-
|
91 |
-
model = AutoModelForSeq2SeqLM.from_pretrained("merve/chatgpt-prompts-bart-long", from_tf=True)
|
92 |
|
93 |
# Define the chatbot response function
|
94 |
def chatbot_response(user_input):
|
|
|
9 |
from datasets import load_dataset
|
10 |
# from transformers import AutoModelForCausalLM, AutoTokenizer
|
11 |
import gradio as gr
|
12 |
+
from peft import PeftModel, PeftConfig
|
13 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
config = PeftConfig.from_pretrained("merve/Mistral-7B-Instruct-v0.2")
|
18 |
+
base_model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-v0.1")
|
19 |
+
model = PeftModel.from_pretrained(base_model, "merve/Mistral-7B-Instruct-v0.2")
|
20 |
+
|
21 |
+
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-v0.1")
|
22 |
+
|
23 |
|
24 |
|
25 |
|
|
|
97 |
# tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
98 |
# model = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.3")
|
99 |
|
100 |
+
|
|
|
101 |
|
102 |
# Define the chatbot response function
|
103 |
def chatbot_response(user_input):
|