hjxdl 0.3.32__py3-none-any.whl → 0.3.34__py3-none-any.whl

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.
hdl/_version.py CHANGED
@@ -17,5 +17,5 @@ __version__: str
17
17
  __version_tuple__: VERSION_TUPLE
18
18
  version_tuple: VERSION_TUPLE
19
19
 
20
- __version__ = version = '0.3.32'
21
- __version_tuple__ = version_tuple = (0, 3, 32)
20
+ __version__ = version = '0.3.34'
21
+ __version_tuple__ = version_tuple = (0, 3, 34)
@@ -81,3 +81,50 @@ def count_character_occurrences(text, char):
81
81
  char = char.lower()
82
82
 
83
83
  return f"{text} 中 {char} 共出现了 {text.count(char)} 次。"
84
+
85
+ # import os
86
+ # import pty
87
+ # import subprocess
88
+ # # import sys
89
+
90
+ # def run_ollama_cmd(cmd: str):
91
+ # command = cmd.split(" ")
92
+ # # 定义要执行的命令
93
+ # # command = ["ollama", "create", ollama_model_name, "-f", ollama_model_file]
94
+ # # 创建伪终端
95
+ # master, slave = pty.openpty()
96
+
97
+ # # 运行命令
98
+ # process = subprocess.Popen(command, stdin=slave, stdout=slave, stderr=slave, text=True, close_fds=True)
99
+
100
+ # # 关闭 slave 端,让 master 端可以读取
101
+ # os.close(slave)
102
+
103
+ # # 处理动态进度条,避免重复输出
104
+ # seen_lines = set()
105
+ # while True:
106
+ # try:
107
+ # output = os.read(master, 1024).decode()
108
+ # if not output:
109
+ # break
110
+
111
+ # # 过滤重复的进度信息
112
+ # for line in output.split("\n"):
113
+ # if line.strip() and line not in seen_lines:
114
+ # seen_lines.add(line)
115
+ # print(line, flush=True) # 逐行打印
116
+ # except OSError:
117
+ # break
118
+
119
+ # # 等待进程结束
120
+ # process.wait()
121
+
122
+
123
+ def run_cmd(cmd: str):
124
+ command = cmd.split(" ")
125
+
126
+ # 直接执行命令,让 stdout 和 stderr 直接流式输出到终端
127
+ process = subprocess.Popen(command, stdout=None, stderr=None)
128
+
129
+ # 等待进程执行完
130
+ process.wait()
@@ -242,7 +242,7 @@ class OpenAIWrapper(object):
242
242
  model=model,
243
243
  messages=messages,
244
244
  tools=tools,
245
- tool_choice=tool_choice
245
+ tool_choice=tool_choice,
246
246
  stream=stream,
247
247
  **kwargs
248
248
  )
@@ -0,0 +1,49 @@
1
+ # import os
2
+ # import pty
3
+ # import subprocess
4
+ # # import sys
5
+
6
+ # def run_ollama_cmd(cmd: str):
7
+ # command = cmd.split(" ")
8
+ # # 定义要执行的命令
9
+ # # command = ["ollama", "create", ollama_model_name, "-f", ollama_model_file]
10
+ # # 创建伪终端
11
+ # master, slave = pty.openpty()
12
+
13
+ # # 运行命令
14
+ # process = subprocess.Popen(command, stdin=slave, stdout=slave, stderr=slave, text=True, close_fds=True)
15
+
16
+ # # 关闭 slave 端,让 master 端可以读取
17
+ # os.close(slave)
18
+
19
+ # # 处理动态进度条,避免重复输出
20
+ # seen_lines = set()
21
+ # while True:
22
+ # try:
23
+ # output = os.read(master, 1024).decode()
24
+ # if not output:
25
+ # break
26
+
27
+ # # 过滤重复的进度信息
28
+ # for line in output.split("\n"):
29
+ # if line.strip() and line not in seen_lines:
30
+ # seen_lines.add(line)
31
+ # print(line, flush=True) # 逐行打印
32
+ # except OSError:
33
+ # break
34
+
35
+ # # 等待进程结束
36
+ # process.wait()
37
+
38
+ import subprocess
39
+
40
+ def run_cmd(cmd: str):
41
+ command = cmd.split(" ")
42
+
43
+ # 直接执行命令,让 stdout 和 stderr 直接流式输出到终端
44
+ process = subprocess.Popen(command, stdout=None, stderr=None)
45
+
46
+ # 等待进程执行完
47
+ process.wait()
48
+
49
+ run_cmd("ollama push ictrek/qwen2.5:14b32ft")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: hjxdl
3
- Version: 0.3.32
3
+ Version: 0.3.34
4
4
  Summary: A collection of functions for Jupyter notebooks
5
5
  Home-page: https://github.com/huluxiaohuowa/hdl
6
6
  Author: Jianxing Hu
@@ -1,5 +1,5 @@
1
1
  hdl/__init__.py,sha256=GffnD0jLJdhkd-vo989v40N90sQbofkayRBwxc6TVhQ,72
2
- hdl/_version.py,sha256=0ZB18d5szcsEdhPhxnZ9F0TWwyVk621gLmTn_NaM_sU,513
2
+ hdl/_version.py,sha256=T2mdLFUhRyvIXBcPDpNzBihjoO6UD14Ov9HOFD_vFnU,513
3
3
  hdl/args/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  hdl/args/loss_args.py,sha256=s7YzSdd7IjD24rZvvOrxLLFqMZQb9YylxKeyelSdrTk,70
5
5
  hdl/controllers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -129,22 +129,23 @@ hdl/utils/desc/template.py,sha256=Kf_tbL-XkDCKNQ3UncbCuYEeUgXEa7kRVCf9TD2b8og,25
129
129
  hdl/utils/desc/tools.py,sha256=tovV4sqjMBCHI6PG5YGJYBKpoXRhgYilzt77ZYTL7Jk,673
130
130
  hdl/utils/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
131
  hdl/utils/general/glob.py,sha256=Zuf7WHU0UdUPOs9UrhxmrCiMC8GrHxQU6n3mTThv6yc,1120
132
- hdl/utils/general/runners.py,sha256=x7QBolp3MrqNV6L4rB6Ueybr26bqkRFZTuXhY0SwyLk,3061
132
+ hdl/utils/general/runners.py,sha256=bOnjpmsAq5Zi4wvIGWgqSEW1gIJpeHiie9e-pmAYX9s,4387
133
133
  hdl/utils/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
134
134
  hdl/utils/llm/chat.py,sha256=q0zQmf-6DeSYOrC2qDn_QFOlILjRHU69eVRUn0eIIbA,26526
135
135
  hdl/utils/llm/chatgr.py,sha256=5F5PJHe8vz3iCfi4TT54DCLRi1UeJshECdVtgvvvao0,3696
136
136
  hdl/utils/llm/embs.py,sha256=Tf0FOYrOFZp7qQpEPiSCXzlgyHH0X9HVTUtsup74a9E,7174
137
137
  hdl/utils/llm/extract.py,sha256=2sK_WJzmYIc8iuWaM9DA6Nw3_6q1O4lJ5pKpcZo-bBA,6512
138
138
  hdl/utils/llm/llama_chat.py,sha256=watcHGOaz-bv3x-yDucYlGk5f8FiqfFhwWogrl334fk,4387
139
- hdl/utils/llm/llm_wrapper.py,sha256=luy69LacBzC4b4GVbj7lCWOLZlyCDMiWQv3yFb1qLuM,15308
139
+ hdl/utils/llm/llm_wrapper.py,sha256=ZjmogEM0TrvlM83LG6l5t8CFnMThBWUmUOvA5WY9ODo,15309
140
+ hdl/utils/llm/ollama.py,sha256=uEdLsNAc6b56r37hNiE3nrd6oZ2lmQ0gYbVvOc9YVIM,1389
140
141
  hdl/utils/llm/vis.py,sha256=SSP6tOwKLq0hWcpM3twI9TitqzBmKjlcGrnXEWYlCzM,26055
141
142
  hdl/utils/llm/visrag.py,sha256=0i-VrxqgiV-J7R3VPshu9oc7-rKjFJOldYik3HDXj6M,10176
142
143
  hdl/utils/schedulers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
143
144
  hdl/utils/schedulers/norm_lr.py,sha256=bDwCmdEK-WkgxQMFBiMuchv8Mm7C0-GZJ6usm-PQk14,4461
144
145
  hdl/utils/weather/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
145
146
  hdl/utils/weather/weather.py,sha256=k11o6wM15kF8b9NMlEfrg68ak-SfSYLN3nOOflFUv-I,4381
146
- hjxdl-0.3.32.dist-info/LICENSE,sha256=lkMiSbeZHBQLB9LJEkS9-L3Z-LBC4yGnKrzHSG8RkPM,2599
147
- hjxdl-0.3.32.dist-info/METADATA,sha256=TTnaKqSV-AJs2lIk_6VXnWLTkRiD6VbZbXT2qogP3iw,1336
148
- hjxdl-0.3.32.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
149
- hjxdl-0.3.32.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
150
- hjxdl-0.3.32.dist-info/RECORD,,
147
+ hjxdl-0.3.34.dist-info/LICENSE,sha256=lkMiSbeZHBQLB9LJEkS9-L3Z-LBC4yGnKrzHSG8RkPM,2599
148
+ hjxdl-0.3.34.dist-info/METADATA,sha256=t1FMY3kDBsuXDrSrJhDrIW_Fd87vN_RRTxDoq04cH18,1336
149
+ hjxdl-0.3.34.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
150
+ hjxdl-0.3.34.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
151
+ hjxdl-0.3.34.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5