Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change provider name and improve chat format #81

Merged
merged 1 commit into from
Mar 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions examples/advanced-local-rag/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,13 @@ def generate_stream(messages: List[Message], context: str = "") -> TextIteratorS
input_text = tokenizer.apply_chat_template(formatted_messages, tokenize=False)
inputs = tokenizer.encode(input_text, return_tensors="pt").to(device)

# 2) Create the streamer (handles partial text as tokens arrive)
streamer = TextIteratorStreamer(tokenizer, skip_prompt=True)
# 2) Create the streamer with skip_prompt and skip_special_tokens
streamer = TextIteratorStreamer(
tokenizer,
skip_prompt=True,
skip_special_tokens=True,
timeout=10.0
)

# 3) Define a thread function that does generation
def run_generation():
Expand Down
4 changes: 3 additions & 1 deletion examples/advanced-local-rag/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions examples/advanced-local-rag/frontend/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useCallback, useMemo } from 'react';
import {
ChatWindow,
RAGProvider,
LexioProvider,
SourcesDisplay,
ContentDisplay,
AdvancedQueryField,
Expand Down Expand Up @@ -135,7 +135,7 @@ function App() {
// 4) Provide the SSE connector and the REST content source to the RAGProvider
return (
<div className="app-container">
<RAGProvider
<LexioProvider
onAction={onAction}
config={{
timeouts: {
Expand Down Expand Up @@ -207,7 +207,7 @@ function App() {
</div>
{/* Handle any encountered errors */}
<ErrorDisplay />
</RAGProvider>
</LexioProvider>
</div>
);
}
Expand Down
8 changes: 4 additions & 4 deletions lexio/lib/components/ChatWindow/AssistantMarkdownContent.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@

/* Lists */
.assistant-markdown-content ul {
white-space: nowrap;
white-space: normal;
margin-top: 6px;
margin-bottom: 6px;
list-style: disc inside;
list-style: disc outside;
padding-left: 10px;
}

.assistant-markdown-content ol {
white-space: nowrap;
white-space: normal;
margin-top: 6px;
margin-bottom: 6px;
list-style: decimal inside;
list-style: decimal outside;
padding-left: 10px;
}

Expand Down
Loading