Skip to content

Commit 4062ae5

Browse files
authored
Merge pull request #1576 from zachlasiuk/main
TEMPLATE: updated RAG demo to only save last prompt and improve spacing
2 parents d7198a4 + ba8ce27 commit 4062ae5

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

assets/css/demo.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,13 @@
264264
margin-bottom: 8px;
265265
line-height: 1.3;
266266
}
267+
.chatbot-response-text li {
268+
margin-bottom: 0;
269+
}
270+
.chatbot-response-text ul, .chatbot-response-text ol {
271+
line-height: 0.4;
272+
}
273+
267274

268275

269276

themes/arm-design-system-hugo-theme/layouts/partials/demo-components/config-rag.html

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@
2323
<div class="c-col">
2424
<h2>RAG Vector Store Details</h2>
2525
<p>This application uses all data on <a href="https://learn.arm.com">learn.arm.com</a>
26-
as the RAG dataset. The content across Learning Paths and Install Guides is segmented into labeled chunks,
27-
and vector embeddings are generated.
28-
This LLM demo references the FAISS vector store to answer your query.</p>
29-
<p><b>Note:</b> Data was sourced on {{.Params.rag_data_cutoff_date}}.</p>
26+
as the RAG dataset as of <b>{{.Params.rag_data_cutoff_date}}</b>.
27+
The content is segmented into labeled chunks, and vector embeddings are generated. This LLM demo references the FAISS vector store to answer your query.
28+
<p>Conversation history is not saved, with only your most recent query being used in the system.</p>
3029
</div>
3130
</div>
3231
</div>

themes/arm-design-system-hugo-theme/layouts/partials/demo-components/llm-chatbot/javascript--llm-chatbot.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,12 @@
186186
}
187187

188188
function updateLLMMetrics(metrics_object) {
189+
190+
if (metrics_object['tps'] == 0) {
191+
// No metrics to show
192+
return;
193+
}
194+
189195
// Show stats if they are not already shown
190196
document.getElementById('stats-populated').hidden = false;
191197
document.getElementById('stats-initial').hidden = true;
@@ -428,10 +434,16 @@
428434
}
429435

430436

431-
all_messages_div.insertBefore(user_div, all_messages_div.firstChild);
432-
433437

438+
{{ if eq .Params.demo_template_name "llm_chatbot_rag_demo" }}
439+
while (all_messages_div.firstChild) {
440+
all_messages_div.removeChild(all_messages_div.firstChild);
441+
}
442+
{{ else if eq .Params.demo_template_name "llm_chatbot_first_demo" }}
443+
{{ else }}
444+
{{ end }}
434445

446+
all_messages_div.insertBefore(user_div, all_messages_div.firstChild);
435447

436448
const chatbot_div = document.createElement('div');
437449
chatbot_div.classList.add('chatbot-message');
@@ -453,6 +465,8 @@
453465
chatbot_div.appendChild(chatbot_span_for_message);
454466
all_messages_div.insertBefore(chatbot_div, all_messages_div.firstChild);
455467

468+
469+
456470
}
457471

458472
// Check textarea content and enable/disable the button

0 commit comments

Comments
 (0)