LLMlight 1.2.1__tar.gz → 1.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/LLMlight.py +1 -1
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/__init__.py +1 -1
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/utils.py +6 -4
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight.egg-info/PKG-INFO +1 -1
- {llmlight-1.2.1 → llmlight-1.2.2}/PKG-INFO +1 -1
- {llmlight-1.2.1 → llmlight-1.2.2}/LICENSE +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/RAG.py +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/examples.py +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/extract.py +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/memory.py +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/read_outlook.py +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight/sqlite_hnsw.py +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight.egg-info/SOURCES.txt +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight.egg-info/dependency_links.txt +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight.egg-info/requires.txt +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/LLMlight.egg-info/top_level.txt +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/MANIFEST.in +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/README.md +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/pyproject.toml +0 -0
- {llmlight-1.2.1 → llmlight-1.2.2}/setup.cfg +0 -0
|
@@ -249,7 +249,7 @@ class LLMlight:
|
|
|
249
249
|
# coding benchmark: LM Studio model card → max_context_length.
|
|
250
250
|
if self.model is not None and (n_ctx is None or n_ctx < 512):
|
|
251
251
|
self.modelinfo = self.get_model_info(model=model)
|
|
252
|
-
self.n_ctx = utils.resolve_max_context(self.modelinfo, fallback=
|
|
252
|
+
self.n_ctx = utils.resolve_max_context(self.modelinfo, fallback=n_ctx)
|
|
253
253
|
if n_ctx is None:
|
|
254
254
|
logger.info(f'n_ctx not set → using model max context length: {self.n_ctx:,}')
|
|
255
255
|
else:
|
|
@@ -260,11 +260,13 @@ def resolve_max_context(modelinfo: dict, fallback: int = 32768) -> int:
|
|
|
260
260
|
2. ``context_length`` of an already-loaded instance
|
|
261
261
|
3. ``fallback`` (module default ``N_CTX``)
|
|
262
262
|
"""
|
|
263
|
+
resolved_fallback = 32768 if fallback is None else int(fallback)
|
|
264
|
+
|
|
263
265
|
if not modelinfo:
|
|
264
266
|
logger.warning(
|
|
265
|
-
f'No model info available; falling back to N_CTX={
|
|
267
|
+
f'No model info available; falling back to N_CTX={resolved_fallback:,}'
|
|
266
268
|
)
|
|
267
|
-
return
|
|
269
|
+
return resolved_fallback
|
|
268
270
|
|
|
269
271
|
max_ctx = modelinfo.get("max_context_length")
|
|
270
272
|
if max_ctx is not None:
|
|
@@ -282,6 +284,6 @@ def resolve_max_context(modelinfo: dict, fallback: int = 32768) -> int:
|
|
|
282
284
|
|
|
283
285
|
logger.warning(
|
|
284
286
|
f'Could not read max_context_length from model info; '
|
|
285
|
-
f'falling back to N_CTX={
|
|
287
|
+
f'falling back to N_CTX={resolved_fallback:,}'
|
|
286
288
|
)
|
|
287
|
-
return
|
|
289
|
+
return resolved_fallback
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|