Spaces:
Runtime error
Runtime error
feat: imporve sysprompt
Browse files
app.py
CHANGED
@@ -34,8 +34,7 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
34 |
|
35 |
SYS = (
|
36 |
"You are a legal AI assistant specialized in GDPR/EDPB. "
|
37 |
-
"
|
38 |
-
"If you cannot find an answer in the context, reply 'I do not know.'"
|
39 |
)
|
40 |
|
41 |
def retrieve(q, k=3):
|
@@ -58,7 +57,7 @@ def retrieve(q, k=3):
|
|
58 |
|
59 |
def make_prompt(q, docs):
|
60 |
context = "\n\n".join(f"Title: {doc['title']}\nPages: {doc['pages']}" for doc in docs)
|
61 |
-
return f"Instruct:{SYS}
|
62 |
|
63 |
@spaces.GPU()
|
64 |
def qa_fn(question, top_k, temperature, max_tokens):
|
|
|
34 |
|
35 |
SYS = (
|
36 |
"You are a legal AI assistant specialized in GDPR/EDPB. "
|
37 |
+
"If you cannot find an answer in the context, reply 'I do not know.' Answer this Question:"
|
|
|
38 |
)
|
39 |
|
40 |
def retrieve(q, k=3):
|
|
|
57 |
|
58 |
def make_prompt(q, docs):
|
59 |
context = "\n\n".join(f"Title: {doc['title']}\nPages: {doc['pages']}" for doc in docs)
|
60 |
+
return f"Instruct:{SYS} {q} based on the following documents:{context}\nOutput:"
|
61 |
|
62 |
@spaces.GPU()
|
63 |
def qa_fn(question, top_k, temperature, max_tokens):
|