speedy-utils 1.0.14__tar.gz → 1.0.16__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.
Files changed (38) hide show
  1. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/PKG-INFO +1 -1
  2. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/pyproject.toml +2 -2
  3. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/__init__.py +10 -15
  4. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/chat_format/display.py +1 -1
  5. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/chat_format/transform.py +1 -2
  6. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/group_messages.py +1 -1
  7. speedy_utils-1.0.16/src/llm_utils/lm/alm.py +859 -0
  8. speedy_utils-1.0.16/src/llm_utils/lm/chat_html.py +246 -0
  9. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/lm/lm.py +386 -78
  10. speedy_utils-1.0.16/src/llm_utils/lm/lm_json.py +68 -0
  11. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/lm/utils.py +1 -1
  12. speedy_utils-1.0.16/src/llm_utils/scripts/README.md +48 -0
  13. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/scripts/vllm_load_balancer.py +0 -1
  14. speedy_utils-1.0.16/src/speedy_utils/__init__.py +176 -0
  15. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/function_decorator.py +1 -4
  16. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/logger.py +1 -1
  17. speedy_utils-1.0.16/src/speedy_utils/common/notebook_utils.py +63 -0
  18. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/report_manager.py +2 -3
  19. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/utils_cache.py +7 -7
  20. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/utils_misc.py +1 -2
  21. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/utils_print.py +2 -65
  22. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/multi_worker/process.py +9 -4
  23. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/scripts/mpython.py +4 -4
  24. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/scripts/openapi_client_codegen.py +1 -5
  25. speedy_utils-1.0.14/src/llm_utils/lm/alm.py +0 -447
  26. speedy_utils-1.0.14/src/speedy_utils/__init__.py +0 -85
  27. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/README.md +0 -0
  28. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/chat_format/__init__.py +0 -0
  29. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/chat_format/utils.py +0 -0
  30. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/lm/__init__.py +0 -0
  31. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/llm_utils/scripts/vllm_serve.py +0 -0
  32. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/all.py +0 -0
  33. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/__init__.py +0 -0
  34. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/clock.py +0 -0
  35. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/common/utils_io.py +0 -0
  36. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/multi_worker/__init__.py +0 -0
  37. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/multi_worker/thread.py +0 -0
  38. {speedy_utils-1.0.14 → speedy_utils-1.0.16}/src/speedy_utils/scripts/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: speedy-utils
3
- Version: 1.0.14
3
+ Version: 1.0.16
4
4
  Summary: Fast and easy-to-use package for data science
5
5
  Author: AnhVTH
6
6
  Author-email: anhvth.226@gmail.com
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "speedy-utils"
3
- version = "1.0.14"
3
+ version = "1.0.16"
4
4
  description = "Fast and easy-to-use package for data science"
5
5
  authors = ["AnhVTH <anhvth.226@gmail.com>"]
6
6
  readme = "README.md"
@@ -11,7 +11,7 @@ packages = [
11
11
  ]
12
12
 
13
13
  [build-system]
14
- requires = ["poetry-core>=1.0.14"]
14
+ requires = ["poetry-core>=1.0.16"]
15
15
  build-backend = "poetry.core.masonry.api"
16
16
 
17
17
  [tool.black]
@@ -1,20 +1,16 @@
1
1
  from .chat_format import (
2
- transform_messages,
3
- transform_messages_to_chatml,
4
- show_chat,
5
- get_conversation_one_turn,
6
- show_string_diff,
7
- display_conversations,
8
2
  build_chatml_input,
9
- format_msgs,
10
3
  display_chat_messages_as_html,
4
+ display_conversations,
5
+ format_msgs,
6
+ get_conversation_one_turn,
7
+ show_chat,
8
+ show_string_diff,
9
+ transform_messages,
10
+ transform_messages_to_chatml,
11
11
  )
12
- from .lm.lm import LM, LMReasoner
12
+ from .lm.lm import LM, LLMTask
13
13
  from .lm.alm import AsyncLM
14
- from .group_messages import (
15
- split_indices_by_length,
16
- group_messages_by_len,
17
- )
18
14
 
19
15
  __all__ = [
20
16
  "transform_messages",
@@ -25,10 +21,9 @@ __all__ = [
25
21
  "display_conversations",
26
22
  "build_chatml_input",
27
23
  "format_msgs",
28
- "split_indices_by_length",
29
- "group_messages_by_len",
24
+ # "group_messages_by_len",
30
25
  "LM",
31
- "LMReasoner",
32
26
  "AsyncLM",
33
27
  "display_chat_messages_as_html",
28
+ "LLMTask",
34
29
  ]
@@ -1,5 +1,5 @@
1
1
  from __future__ import annotations
2
- from typing import List, Tuple, Sequence, Any, Dict, Optional
2
+ from typing import Any, Optional
3
3
  from IPython.display import HTML, display
4
4
  from difflib import SequenceMatcher
5
5
 
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
  from copy import deepcopy
3
- from typing import Callable, Dict, List, Sequence
4
3
 
5
4
 
6
5
  def identify_format(item):
@@ -114,7 +113,7 @@ def transform_messages(
114
113
 
115
114
  def transform_messages_to_chatml(input_data, input_format="auto"):
116
115
  if input_format == "auto":
117
- input_data = raw_data = deepcopy(input_data)
116
+ input_data = deepcopy(input_data)
118
117
  if isinstance(input_data, list):
119
118
  input_format = "chatlm"
120
119
  assert (
@@ -76,7 +76,7 @@ def group_messages_by_len(
76
76
  """
77
77
  if messages is None:
78
78
  raise ValueError("messages parameter cannot be None")
79
- from transformers.models.auto.tokenization_auto import AutoTokenizer
79
+ from transformers.models.auto.tokenization_auto import AutoTokenizer # type: ignore
80
80
 
81
81
  tokenizer = AutoTokenizer.from_pretrained(model_name)
82
82