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.
@@ -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=N_CTX)
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:
@@ -18,7 +18,7 @@ from LLMlight.LLMlight import (
18
18
 
19
19
  __author__ = 'Erdogan Tasksen'
20
20
  __email__ = 'erdogant@gmail.com'
21
- __version__ = '1.2.1'
21
+ __version__ = '1.2.2'
22
22
 
23
23
  # Setup root logger
24
24
  # Setup package-level logger
@@ -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={fallback:,}'
267
+ f'No model info available; falling back to N_CTX={resolved_fallback:,}'
266
268
  )
267
- return int(fallback)
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={fallback:,}'
287
+ f'falling back to N_CTX={resolved_fallback:,}'
286
288
  )
287
- return int(fallback)
289
+ return resolved_fallback
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LLMlight
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: LLMlight is a Python library for ...
5
5
  Author-email: Erdogan Taskesen <erdogant@gmail.com>
6
6
  License-Expression: MIT
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: LLMlight
3
- Version: 1.2.1
3
+ Version: 1.2.2
4
4
  Summary: LLMlight is a Python library for ...
5
5
  Author-email: Erdogan Taskesen <erdogant@gmail.com>
6
6
  License-Expression: MIT
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