pycoze 0.1.89__tar.gz → 0.1.90__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. {pycoze-0.1.89 → pycoze-0.1.90}/PKG-INFO +1 -1
  2. pycoze-0.1.90/pycoze/ai/__init__.py +1 -0
  3. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/ai/vram_reserve.py +3 -11
  4. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze.egg-info/PKG-INFO +1 -1
  5. {pycoze-0.1.89 → pycoze-0.1.90}/setup.py +1 -1
  6. pycoze-0.1.89/pycoze/ai/__init__.py +0 -1
  7. {pycoze-0.1.89 → pycoze-0.1.90}/LICENSE +0 -0
  8. {pycoze-0.1.89 → pycoze-0.1.90}/README.md +0 -0
  9. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/__init__.py +0 -0
  10. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/access/__init__.py +0 -0
  11. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/access/tool_for_bot.py +0 -0
  12. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/__init__.py +0 -0
  13. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/agent/__init__.py +0 -0
  14. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/agent/agent.py +0 -0
  15. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/agent/agent_types/__init__.py +0 -0
  16. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/agent/agent_types/openai_func_call_agent.py +0 -0
  17. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/agent/assistant.py +0 -0
  18. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/agent/chat.py +0 -0
  19. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/bot/bot.py +0 -0
  20. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/module.py +0 -0
  21. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/ui/__init__.py +0 -0
  22. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/ui/base.py +0 -0
  23. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/ui/color.py +0 -0
  24. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/ui/typ.py +0 -0
  25. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/ui/ui_def.py +0 -0
  26. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/utils/__init__.py +0 -0
  27. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/utils/arg.py +0 -0
  28. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze/utils/text_or_file.py +0 -0
  29. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze.egg-info/SOURCES.txt +0 -0
  30. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze.egg-info/dependency_links.txt +0 -0
  31. {pycoze-0.1.89 → pycoze-0.1.90}/pycoze.egg-info/top_level.txt +0 -0
  32. {pycoze-0.1.89 → pycoze-0.1.90}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.89
3
+ Version: 0.1.90
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -0,0 +1 @@
1
+ from .vram_reserve import reserve_vram, reserve_vram_retry, unreserve_vram
@@ -88,33 +88,25 @@ def reserve_vram_retry(gb, retry=None, uid=None):
88
88
  retry = sys.maxsize
89
89
  for i in range(retry):
90
90
  time.sleep(1)
91
- if i % 10 == 0 or i < 10:
91
+ if i % 10 == 0 or i < 10 and i != 0:
92
92
  print(f"重试第{i}次")
93
93
  if reserve_vram(gb, uid):
94
94
  return True
95
95
  return False
96
96
 
97
97
 
98
- def release_vram(uid=None):
98
+ def unreserve_vram(uid=None):
99
99
  if uid is None:
100
100
  uid = f"pid:{os.getpid()}"
101
101
  with sqlite3.connect(DATABASE_PATH) as conn:
102
102
  cursor = conn.cursor()
103
103
  cursor.execute(f"DELETE FROM {TABLE_NAME} WHERE uid = ?", (uid,))
104
104
  conn.commit()
105
- # 计算释放后的剩余VRAM大小
106
- cursor.execute(f"SELECT SUM(reserved_gb) FROM {TABLE_NAME}")
107
- total_reserved = cursor.fetchone()[0]
108
- if total_reserved is None:
109
- total_reserved = 0.0
110
- available_gb = get_vram_resources() - total_reserved
111
- print(f"释放成功,剩余VRAM大小: {available_gb} GB")
112
105
 
113
106
 
114
107
  # 注册退出时的清理函数
115
108
  def cleanup():
116
- release_vram()
117
- print("程序退出,VRAM资源已释放")
109
+ unreserve_vram()
118
110
 
119
111
 
120
112
  def initialize_and_check():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pycoze
3
- Version: 0.1.89
3
+ Version: 0.1.90
4
4
  Summary: Package for pycoze only!
5
5
  Author: Yuan Jie Xiong
6
6
  Author-email: aiqqqqqqq@qq.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pycoze",
5
- version="0.1.89",
5
+ version="0.1.90",
6
6
  packages=find_packages(),
7
7
  install_requires=[],
8
8
  author="Yuan Jie Xiong",
@@ -1 +0,0 @@
1
- from .vram_reserve import reserve_vram_retry, release_vram, reserve_vram
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