Skip to content

Commit f9c01c2

Browse files
authored
Merge pull request #237 from codelion/fix-package-install
Fix package install
2 parents 12ac786 + 8f09637 commit f9c01c2

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include optillm.py
12
include optillm/plugins/*.py
23
include optillm/cepo/*.py
34
include optillm/cepo/configs/*.yaml

optillm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33

44
# Version information
5-
__version__ = "0.2.0"
5+
__version__ = "0.2.1"
66

77
# Get the path to the root optillm.py
88
spec = util.spec_from_file_location(

optillm/plugins/longcepo/mapreduce.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ def fetch_map_response(client, model, chunk, query, system_prompt, summary):
158158
tokenizer,
159159
cb_log,
160160
longcepo_config,
161+
irrelevance_tags,
161162
)
162-
result = remove_chunks(result, irrelevance_tags)
163163
if not result:
164164
return "No information", cb_log
165165

@@ -200,6 +200,7 @@ def collapse_chunks(
200200
tokenizer,
201201
cb_log: CBLog,
202202
longcepo_config: LongCepoConfig,
203+
irrelevance_tags: Tuple[str] = ("[NO INFORMATION]",),
203204
) -> Tuple[List[str], CBLog]:
204205
"""
205206
Collapses context chunk pairs in sliding window until the total token count fits within the context window.
@@ -221,7 +222,7 @@ def collapse_chunks(
221222
num_tokens = get_prompt_length(format_chunk_list(context_chunks), tokenizer)
222223
token_budget = (
223224
longcepo_config.max_context_window
224-
- get_prompt_length(longcepo_config.collapse_prompt, tokenizer)
225+
- get_prompt_length(longcepo_config.reduce_prompt, tokenizer)
225226
- longcepo_config.max_output_tokens
226227
)
227228
logger.info(f"Pre-collapse length of chunks {num_tokens}, allowed {token_budget}")
@@ -269,6 +270,7 @@ def fetch_collapse_response(client, model, docs, query, system_prompt):
269270
system_prompt,
270271
cb_log,
271272
)
273+
context_chunks = remove_chunks(context_chunks, irrelevance_tags)
272274
merge_pair_idx = (merge_pair_idx + 1) % max(len(context_chunks) - 1, 1)
273275
num_tokens = get_prompt_length(format_chunk_list(context_chunks), tokenizer)
274276
collapse_step += 1

pyproject.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "optillm"
7-
version = "0.2.0"
7+
version = "0.2.1"
88
description = "An optimizing inference proxy for LLMs."
99
readme = "README.md"
1010
license = "Apache-2.0"
@@ -81,4 +81,7 @@ optillm = [
8181
"plugins/*.py",
8282
"cepo/*.py",
8383
"cepo/configs/*.yaml",
84-
]
84+
]
85+
86+
[tool.setuptools.data-files]
87+
"" = ["optillm.py"]

0 commit comments

Comments
 (0)