Skip to content
Open
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
3 changes: 1 addition & 2 deletions server/retriever/splitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def __init__(
every document
"""
if chunk_overlap > chunk_size:
raise ValueError(f"Got a larger chunk overlap ({
chunk_overlap}) than chunk size ({chunk_size}), should be smaller.")
raise ValueError(f"Got a larger chunk overlap ({chunk_overlap}) than chunk size ({chunk_size}), should be smaller.")
self._chunk_size = chunk_size
self._chunk_overlap = chunk_overlap
self._length_function = length_function
Expand Down
7 changes: 5 additions & 2 deletions server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ def format_messages(messages: List[Dict], indexed_files: Optional[str], instruct
'personalization', '').strip().replace('\n', '; ')
response = instructions.get('response', '').strip().replace('\n', '; ')

context = f"with background knowledge of {
indexed_files.strip().replace('\n', '; ')}" if indexed_files else ''
bits = indexed_files.strip().replace('\n', '; ')
if indexed_files:
context = f"with background knowledge of {bits}"
else:
context = ''
audience = personalization if personalization else 'general'
style = response if response else 'technical, accurate, and professional'

Expand Down
3 changes: 1 addition & 2 deletions server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,7 @@ def sample(logits: mx.array) -> Tuple[mx.array, float]:
repetition_penalty < 0 or not isinstance(repetition_penalty, float)
):
raise ValueError(
f"repetition_penalty must be a non-negative float, got {
repetition_penalty}"
f"repetition_penalty must be a non-negative float, got {repetition_penalty}"
)

y = prompt
Expand Down