hjxdl 0.0.4__tar.gz → 0.0.6__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 (117) hide show
  1. {hjxdl-0.0.4/hjxdl.egg-info → hjxdl-0.0.6}/PKG-INFO +2 -1
  2. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/_version.py +2 -2
  3. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/llm/chat.py +33 -3
  4. {hjxdl-0.0.4 → hjxdl-0.0.6/hjxdl.egg-info}/PKG-INFO +2 -1
  5. {hjxdl-0.0.4 → hjxdl-0.0.6}/hjxdl.egg-info/SOURCES.txt +2 -0
  6. hjxdl-0.0.6/hjxdl.egg-info/requires.txt +1 -0
  7. hjxdl-0.0.6/requirements.txt +1 -0
  8. {hjxdl-0.0.4 → hjxdl-0.0.6}/setup.py +14 -1
  9. hjxdl-0.0.6/version.txt +1 -0
  10. hjxdl-0.0.4/version.txt +0 -1
  11. {hjxdl-0.0.4 → hjxdl-0.0.6}/.github/workflows/python-publish.yml +0 -0
  12. {hjxdl-0.0.4 → hjxdl-0.0.6}/.gitignore +0 -0
  13. {hjxdl-0.0.4 → hjxdl-0.0.6}/.gitmodules +0 -0
  14. {hjxdl-0.0.4 → hjxdl-0.0.6}/MANIFEST.in +0 -0
  15. {hjxdl-0.0.4 → hjxdl-0.0.6}/README.md +0 -0
  16. {hjxdl-0.0.4 → hjxdl-0.0.6}/__init__.py +0 -0
  17. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/__init__.py +0 -0
  18. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/args/__init__.py +0 -0
  19. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/args/loss_args.py +0 -0
  20. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/__init__.py +0 -0
  21. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/al/__init__.py +0 -0
  22. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/al/al.py +0 -0
  23. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/al/dispatcher.py +0 -0
  24. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/al/feedback.py +0 -0
  25. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/explain/__init__.py +0 -0
  26. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/explain/shapley.py +0 -0
  27. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/explain/subgraphx.py +0 -0
  28. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/predictors/gin_predictor.py +0 -0
  29. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/predictors/rxn_predictor.py +0 -0
  30. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/predictors/torch_predictor.py +0 -0
  31. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/train/__init__.py +0 -0
  32. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/train/rxn_train.py +0 -0
  33. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/train/train.py +0 -0
  34. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/train/train_ginet.py +0 -0
  35. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/train/trainer_base.py +0 -0
  36. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/controllers/train/trainer_iterative.py +0 -0
  37. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/__init__.py +0 -0
  38. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/__init__.py +0 -0
  39. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/base_dataset.py +0 -0
  40. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/fp/__init__.py +0 -0
  41. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/fp/fp_dataset.py +0 -0
  42. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/graph/__init__.py +0 -0
  43. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/graph/chiral.py +0 -0
  44. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/graph/gin.py +0 -0
  45. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/graph/molnet.py +0 -0
  46. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/__init__.py +0 -0
  47. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/chiral_graph.py +0 -0
  48. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/collate_funcs/__init__.py +0 -0
  49. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/collate_funcs/fp.py +0 -0
  50. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/collate_funcs/rxn.py +0 -0
  51. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/general.py +0 -0
  52. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/loaders/spliter.py +0 -0
  53. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/samplers/__init__.py +0 -0
  54. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/samplers/chiral.py +0 -0
  55. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/seq/__init__.py +0 -0
  56. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/seq/rxn_dataset.py +0 -0
  57. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/dataset/utils.py +0 -0
  58. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/data/to_mols.py +0 -0
  59. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/__init__.py +0 -0
  60. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/fp/__init__.py +0 -0
  61. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/fp/features_generators.py +0 -0
  62. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/graph/__init__.py +0 -0
  63. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/graph/featurization.py +0 -0
  64. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/utils/__init__.py +0 -0
  65. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/utils/utils.py +0 -0
  66. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/features/vocab.txt +0 -0
  67. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/include/add2.h +0 -0
  68. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/kernel/add2_kernel.cu +0 -0
  69. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/kernel/test +0 -0
  70. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/kernel/test.cu +0 -0
  71. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/__init__.py +0 -0
  72. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/general/__init__.py +0 -0
  73. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/general/gp.py +0 -0
  74. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/general/linear.py +0 -0
  75. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/graph/__init__.py +0 -0
  76. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/graph/chiral_graph.py +0 -0
  77. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/graph/gcn.py +0 -0
  78. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/graph/gin.py +0 -0
  79. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/graph/tetra.py +0 -0
  80. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/graph/transformer.py +0 -0
  81. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/layers/sequential/__init__.py +0 -0
  82. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/metric_loss/__init__.py +0 -0
  83. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/metric_loss/loss.py +0 -0
  84. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/metric_loss/metric.py +0 -0
  85. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/metric_loss/multi_label.py +0 -0
  86. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/metric_loss/nt_xent.py +0 -0
  87. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/__init__.py +0 -0
  88. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/chiral_gnn.py +0 -0
  89. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/fast_transformer.py +0 -0
  90. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/ginet.py +0 -0
  91. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/linear.py +0 -0
  92. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/model_dict.py +0 -0
  93. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/norm_flows.py +0 -0
  94. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/optim_dict.py +0 -0
  95. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/rxn.py +0 -0
  96. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/models/utils.py +0 -0
  97. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/ops/__init__.py +0 -0
  98. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/ops/utils.py +0 -0
  99. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/optims/__init__.py +0 -0
  100. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/optims/nadam.py +0 -0
  101. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/pytorch/add2_ops.cpp +0 -0
  102. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/__init__.py +0 -0
  103. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/chemical_tools/__init__.py +0 -0
  104. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/chemical_tools/query_info.py +0 -0
  105. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/chemical_tools/sdf.py +0 -0
  106. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/database_tools/__init__.py +0 -0
  107. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/database_tools/connect.py +0 -0
  108. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/general/__init__.py +0 -0
  109. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/general/glob.py +0 -0
  110. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/llm/__init__.py +0 -0
  111. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/schedulers/__init__.py +0 -0
  112. {hjxdl-0.0.4 → hjxdl-0.0.6}/hdl/utils/schedulers/norm_lr.py +0 -0
  113. {hjxdl-0.0.4 → hjxdl-0.0.6}/hjxdl.egg-info/dependency_links.txt +0 -0
  114. {hjxdl-0.0.4 → hjxdl-0.0.6}/hjxdl.egg-info/top_level.txt +0 -0
  115. {hjxdl-0.0.4 → hjxdl-0.0.6}/pyproject.toml +0 -0
  116. {hjxdl-0.0.4 → hjxdl-0.0.6}/setup.cfg +0 -0
  117. {hjxdl-0.0.4 → hjxdl-0.0.6}/update_main.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hjxdl
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: A collection of functions for Jupyter notebooks
5
5
  Home-page: https://github.com/huluxiaohuowa/hdl
6
6
  Author: Jianxing Hu
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.6
12
12
  Description-Content-Type: text/markdown
13
+ Requires-Dist: jupyfuncs
13
14
 
14
15
  # DL framework by Jianxing
15
16
 
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.0.4'
16
- __version_tuple__ = version_tuple = (0, 0, 4)
15
+ __version__ = version = '0.0.6'
16
+ __version_tuple__ = version_tuple = (0, 0, 6)
@@ -16,14 +16,15 @@ class GGUF_M():
16
16
  server_ip: str = "127.0.0.1",
17
17
  server_port: int = 8000,
18
18
  ):
19
- """Initialize the model from a local path.
20
- Here it does not manage chat histories.
19
+ """Initialize the model with the provided model path and optional parameters.
21
20
 
22
21
  Args:
23
22
  model_path (str): The path to the model.
24
23
  device (str, optional): The device to use for model initialization. Defaults to 'gpu'.
25
24
  generation_kwargs (dict, optional): Additional keyword arguments for model generation. Defaults to {}.
26
- """
25
+ server_ip (str, optional): The IP address of the server. Defaults to "127.0.0.1".
26
+ server_port (int, optional): The port of the server. Defaults to 8000.
27
+ """
27
28
  # 从本地初始化模型
28
29
  super().__init__()
29
30
  self.generation_kwargs = generation_kwargs
@@ -130,6 +131,15 @@ class OpenAI_M():
130
131
  server_ip: str = "172.28.1.2",
131
132
  server_port: int = 8000,
132
133
  ):
134
+ """Initialize the class with the specified parameters.
135
+
136
+ Args:
137
+ model_path (str, optional): Path to the model file. Defaults to None.
138
+ device (str, optional): Device to run the model on. Defaults to 'gpu'.
139
+ generation_kwargs (dict, optional): Additional keyword arguments for model generation. Defaults to {}.
140
+ server_ip (str, optional): IP address of the server. Defaults to "172.28.1.2".
141
+ server_port (int, optional): Port number of the server. Defaults to 8000.
142
+ """
133
143
  self.model_path = model_path
134
144
  self.server_ip = server_ip
135
145
  self.server_port = server_port
@@ -142,6 +152,16 @@ class OpenAI_M():
142
152
  # history: list = [],
143
153
  **kwargs: t.Any,
144
154
  ) -> str:
155
+ """Invoke the chatbot with the given prompt and return the response.
156
+
157
+ Args:
158
+ prompt (str): The prompt to provide to the chatbot.
159
+ stop (list[str], optional): List of strings that indicate the end of the conversation. Defaults to ["USER:", "ASSISTANT:"].
160
+ **kwargs: Additional keyword arguments to pass to the chatbot.
161
+
162
+ Returns:
163
+ str: The response generated by the chatbot.
164
+ """
145
165
  resp = chat_oai_invoke(
146
166
  base_url=self.base_url,
147
167
  model=self.model_path,
@@ -156,6 +176,16 @@ class OpenAI_M():
156
176
  # history: list = [],
157
177
  **kwargs: t.Any,
158
178
  ) -> str:
179
+ """Generate a response by streaming conversation with the OpenAI chat model.
180
+
181
+ Args:
182
+ prompt (str): The prompt to start the conversation.
183
+ stop (list[str], optional): List of strings that indicate when the conversation should stop. Defaults to ["USER:", "ASSISTANT:"].
184
+ **kwargs: Additional keyword arguments to pass to the chat model.
185
+
186
+ Returns:
187
+ str: The response generated by the chat model.
188
+ """
159
189
  resp = chat_oai_stream(
160
190
  base_url=self.base_url,
161
191
  model=self.model_path,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hjxdl
3
- Version: 0.0.4
3
+ Version: 0.0.6
4
4
  Summary: A collection of functions for Jupyter notebooks
5
5
  Home-page: https://github.com/huluxiaohuowa/hdl
6
6
  Author: Jianxing Hu
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Operating System :: OS Independent
11
11
  Requires-Python: >=3.6
12
12
  Description-Content-Type: text/markdown
13
+ Requires-Dist: jupyfuncs
13
14
 
14
15
  # DL framework by Jianxing
15
16
 
@@ -4,6 +4,7 @@ MANIFEST.in
4
4
  README.md
5
5
  __init__.py
6
6
  pyproject.toml
7
+ requirements.txt
7
8
  setup.py
8
9
  update_main.sh
9
10
  version.txt
@@ -109,4 +110,5 @@ hdl/utils/schedulers/norm_lr.py
109
110
  hjxdl.egg-info/PKG-INFO
110
111
  hjxdl.egg-info/SOURCES.txt
111
112
  hjxdl.egg-info/dependency_links.txt
113
+ hjxdl.egg-info/requires.txt
112
114
  hjxdl.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ jupyfuncs
@@ -0,0 +1 @@
1
+ jupyfuncs
@@ -2,6 +2,16 @@ from setuptools import setup, find_packages
2
2
  import setuptools_scm
3
3
 
4
4
 
5
+ def read_requirements():
6
+ """读取 requirements.txt 文件并返回依赖列表"""
7
+ with open('requirements.txt', 'r', encoding='utf-8') as file:
8
+ return [
9
+ line.strip()
10
+ for line in file
11
+ if line.strip() and not line.startswith('#')
12
+ ]
13
+
14
+
5
15
  def custom_version_scheme(version):
6
16
  """自定义版本号方案,确保没有 .dev 后缀"""
7
17
  if version.exact:
@@ -11,10 +21,12 @@ def custom_version_scheme(version):
11
21
  else:
12
22
  return version.format_with("0.0.0")
13
23
 
24
+
14
25
  def custom_local_scheme(version):
15
26
  """自定义本地版本方案,确保没有本地版本后缀"""
16
27
  return ""
17
28
 
29
+
18
30
  setup(
19
31
  name="hjxdl",
20
32
  use_scm_version={
@@ -35,5 +47,6 @@ setup(
35
47
  "Operating System :: OS Independent",
36
48
  ],
37
49
  python_requires='>=3.6',
38
- setup_requires=['setuptools_scm']
50
+ setup_requires=['setuptools_scm'],
51
+ install_requires=read_requirements()
39
52
  )
@@ -0,0 +1 @@
1
+ 0.0.6
hjxdl-0.0.4/version.txt DELETED
@@ -1 +0,0 @@
1
- 0.0.4
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
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
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
File without changes
File without changes
File without changes
File without changes
File without changes