hjxdl 0.1.43__py3-none-any.whl → 0.1.44__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
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.1.43'
16
- __version_tuple__ = version_tuple = (0, 1, 43)
15
+ __version__ = version = '0.1.44'
16
+ __version_tuple__ = version_tuple = (0, 1, 44)
hdl/models/utils.py CHANGED
@@ -49,10 +49,10 @@ def load_model(
49
49
  init_args = checkpoint['init_args']
50
50
  assert model_name is not None
51
51
  model = MODEL_DICT[model_name](**init_args)
52
- model.load_state_dict(
53
- checkpoint['model_state_dict'],
52
+ model.load_state_dict(
53
+ checkpoint['model_state_dict'],
54
54
  )
55
-
55
+
56
56
  elif isinstance(model, nn.DataParallel):
57
57
  state_dict = checkpoint['model_state_dict']
58
58
  from collections import OrderedDict
@@ -66,10 +66,10 @@ def load_model(
66
66
  new_state_dict[k] = v
67
67
  model.load_state_dict(new_state_dict)
68
68
  else:
69
- model.load_state_dict(
70
- checkpoint['model_state_dict'],
69
+ model.load_state_dict(
70
+ checkpoint['model_state_dict'],
71
71
  )
72
-
72
+
73
73
  if optimizer is not None:
74
74
  optimizer.load_state_dict(checkpoint['optimizer_state_dict'])
75
75
  epoch = checkpoint.get('epoch', 0)
@@ -80,4 +80,4 @@ def load_model(
80
80
  else:
81
81
  model.eval()
82
82
 
83
- return model, optimizer, epoch, loss
83
+ return model, optimizer, epoch, loss
@@ -1,7 +1,7 @@
1
1
  FN_DESC = {
2
2
  "get_weather": """
3
3
  ## 函数名:get_weather
4
- 描述:在用户询问一个城市的天气时,调用此工具获得此城市的天气信息
4
+ 描述:只有在用户询问一个城市的天气时,调用此工具获得此城市的天气信息
5
5
  参数:
6
6
  # city (str): 城市名
7
7
  返回值 (str):天气信息
@@ -17,7 +17,7 @@ FN_DESC = {
17
17
  """,
18
18
  "get_datetime_by_cityname": """
19
19
  ## 函数名:get_datetime_by_cityname
20
- 描述:在用户询问一个城市当前的日期或时间时,调用此工具可以获得此城市当前的日期和时间
20
+ 描述:只有在用户询问一个城市当前的日期或时间时,调用此工具可以获得此城市当前的日期和时间
21
21
  参数:
22
22
  # city (str): 城市名
23
23
  返回值 (str):这个城市当前所在时区的日期和时间
@@ -33,7 +33,7 @@ FN_DESC = {
33
33
  """,
34
34
  "web_search_text": """
35
35
  ## 函数名:web_search_text
36
- 描述:在用户明确要联网查询回答他的问题时,调用此工具可以获得该问题联网搜索的相关内容
36
+ 描述:在用户明确要联网查询回答他的问题时,调用此工具可以获得该问题联网搜索的相关内容,若用户的提问中没有提到“联网查询”,则不要调用此工具
37
37
  参数:
38
38
  # query_text (str): 从用户提的问题中获取,用于在网络中搜索信息
39
39
  # max_results (int, optional): 搜索条目的最大数目,若用户指定了数目,则使用用户指定的数目,若用户提问中没有指定,你需要在下面的json中"max_results"这一项指定为数值3。
@@ -6,7 +6,7 @@ FN_TEMPLATE = """
6
6
  "function_name":需要要调用的函数的名称。
7
7
  "params":函数所需的参数,一般为字符串,注意字符串要在双引号 "" 之间。
8
8
 
9
- 若不需要调用函数,或提供的函数无法解决用户的问题时,则返回如下字典,并且不应包含其他多余文字,避免出现格式化问题:
9
+ 若不需要调用函数,或提供的函数无法解决用户的问题时,或没有达到下文中相关函数描述的触发条件时,则返回如下字典,并且不应包含其他多余文字,避免出现格式化问题:
10
10
  {
11
11
  "function_name": null
12
12
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: hjxdl
3
- Version: 0.1.43
3
+ Version: 0.1.44
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=je8dvdNwIt059HEr1qk2npsW8vrRavEuNhEuUauD0n0,413
2
+ hdl/_version.py,sha256=IIqs5uWJ8FFsWjDm6cFCsir1SFd1NDSs1R-SbdEIUJQ,413
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
@@ -108,7 +108,7 @@ hdl/models/model_dict.py,sha256=uRh13nch7rab3DajnDR_usp_1R0b37WUgNoiqOobk-s,402
108
108
  hdl/models/norm_flows.py,sha256=nROlAaToUOtqi99_BPe6rlPHpUS38YFAtDll1xmGv5U,830
109
109
  hdl/models/optim_dict.py,sha256=xvefZwCGebIXhRLSbcoGa3WVUWW2kEEm0Gsgp8Q9SQw,231
110
110
  hdl/models/rxn.py,sha256=6MEkzjWEgWgl14EkdprvVtycX1q-xlYnXekM1ROKFL0,1557
111
- hdl/models/utils.py,sha256=OOdwZ7f5ciaEFNM9zouNpLxj8S8kGKsSIM0msnoJ3bQ,2221
111
+ hdl/models/utils.py,sha256=LgeZhsGw3_VAjgMFB9vGamIFoe9UAHM21xhDIRA8vtE,2210
112
112
  hdl/ops/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
113
113
  hdl/ops/utils.py,sha256=GIe95pJYVqOQQ91ELb1tfogVFzGg2VJdQmIFX8aHeyM,1053
114
114
  hdl/optims/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -122,8 +122,8 @@ hdl/utils/database_tools/connect.py,sha256=KUnVG-8raifEJ_N0b3c8LkTTIfn9NIyw8LX6q
122
122
  hdl/utils/database_tools/datetime.py,sha256=xqE2xNiOpADzX-R8_bM0bioJRF3Ay9Jp1CAG6dy6uVI,1202
123
123
  hdl/utils/database_tools/web.py,sha256=vZJYWA02QbyUUMGLDX710cexn7RlfWeHa8YwK3UsDZ0,1934
124
124
  hdl/utils/desc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
125
- hdl/utils/desc/func_desc.py,sha256=z7KXjTyE-tr0VZ1ZtA7G7phSfuq48lUaTwWb0LRyY6I,1626
126
- hdl/utils/desc/template.py,sha256=a3NcSihzZMm9Bk76iDVe54_xBDceGmLebS0XMONE3nk,1172
125
+ hdl/utils/desc/func_desc.py,sha256=wjGAfMPmpj_iSNJvi6vpRBDIuQGF318aL44wRdz8TK0,1719
126
+ hdl/utils/desc/template.py,sha256=K45KX6LwHXW-VcPa5jUJRUDmUQMX0-zSi3tXUHlyMG8,1235
127
127
  hdl/utils/general/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
128
128
  hdl/utils/general/glob.py,sha256=8-RCnt6L297wMIfn34ZAMCsGCZUjHG3MGglGZI1cX0g,491
129
129
  hdl/utils/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -135,7 +135,7 @@ hdl/utils/schedulers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
135
135
  hdl/utils/schedulers/norm_lr.py,sha256=bDwCmdEK-WkgxQMFBiMuchv8Mm7C0-GZJ6usm-PQk14,4461
136
136
  hdl/utils/weather/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
137
  hdl/utils/weather/weather.py,sha256=k11o6wM15kF8b9NMlEfrg68ak-SfSYLN3nOOflFUv-I,4381
138
- hjxdl-0.1.43.dist-info/METADATA,sha256=LGqlY_wpq0VEHhhD8Esq42vtWtWPbXfHx858UrXg1Z8,737
139
- hjxdl-0.1.43.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
140
- hjxdl-0.1.43.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
141
- hjxdl-0.1.43.dist-info/RECORD,,
138
+ hjxdl-0.1.44.dist-info/METADATA,sha256=Ax6NueiUU7GZifaDxk2uti5gMBfSoXLTqyrdZw_-xMc,737
139
+ hjxdl-0.1.44.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
140
+ hjxdl-0.1.44.dist-info/top_level.txt,sha256=-kxwTM5JPhylp06z3zAVO3w6_h7wtBfBo2zgM6YZoTk,4
141
+ hjxdl-0.1.44.dist-info/RECORD,,
File without changes