Spaces:
Runtime error
Runtime error
feat/todo
#2
by bek-cs - opened
app.py
CHANGED
|
@@ -35,8 +35,8 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
| 35 |
)
|
| 36 |
|
| 37 |
SYS = (
|
| 38 |
-
"You are a legal AI assistant specialized in GDPR/EDPB.
|
| 39 |
-
"If you cannot find an answer in the context, it's okay to speculate. But if so, make it clear.
|
| 40 |
"Answer this Question:"
|
| 41 |
)
|
| 42 |
|
|
@@ -101,11 +101,13 @@ def qa_fn(question, top_k, temperature, max_tokens):
|
|
| 101 |
output = output.split("Output:", 1)[1].strip()
|
| 102 |
return "\n# Generated Answer\n", output,"\n# Used Documents\n", file_links, "\n# Used Context\n", markdown_chunks
|
| 103 |
|
|
|
|
|
|
|
| 104 |
heading_answer = gr.Markdown(label="Answer Heading")
|
| 105 |
outputs_answer = gr.Textbox(label="Answer")
|
| 106 |
-
outputs_link = gr.Markdown(label="Source Link")
|
| 107 |
heading_links = gr.Markdown(label="Links Heading")
|
| 108 |
heading_chunks = gr.Markdown(label="Chunks Heading")
|
|
|
|
| 109 |
outputs_chunks = gr.Markdown(label="Used Chunks")
|
| 110 |
|
| 111 |
demo = gr.Interface(
|
|
|
|
| 35 |
)
|
| 36 |
|
| 37 |
SYS = (
|
| 38 |
+
"You are a legal AI assistant specialized in GDPR/EDPB."
|
| 39 |
+
"If you cannot find an answer in the context, it's okay to speculate. But if so, make it clear."
|
| 40 |
"Answer this Question:"
|
| 41 |
)
|
| 42 |
|
|
|
|
| 101 |
output = output.split("Output:", 1)[1].strip()
|
| 102 |
return "\n# Generated Answer\n", output,"\n# Used Documents\n", file_links, "\n# Used Context\n", markdown_chunks
|
| 103 |
|
| 104 |
+
# TODO first model to make prompt more efficient
|
| 105 |
+
|
| 106 |
heading_answer = gr.Markdown(label="Answer Heading")
|
| 107 |
outputs_answer = gr.Textbox(label="Answer")
|
|
|
|
| 108 |
heading_links = gr.Markdown(label="Links Heading")
|
| 109 |
heading_chunks = gr.Markdown(label="Chunks Heading")
|
| 110 |
+
outputs_link = gr.Markdown(label="Source Link")
|
| 111 |
outputs_chunks = gr.Markdown(label="Used Chunks")
|
| 112 |
|
| 113 |
demo = gr.Interface(
|