maque 0.1.3__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 (166) hide show
  1. maque-0.1.3/.gitignore +173 -0
  2. maque-0.1.3/LICENSE +21 -0
  3. maque-0.1.3/PKG-INFO +475 -0
  4. maque-0.1.3/README.md +324 -0
  5. maque-0.1.3/maque/__init__.py +31 -0
  6. maque-0.1.3/maque/__main__.py +782 -0
  7. maque-0.1.3/maque/ai_platform/__init__.py +0 -0
  8. maque-0.1.3/maque/ai_platform/crawl.py +45 -0
  9. maque-0.1.3/maque/ai_platform/metrics.py +258 -0
  10. maque-0.1.3/maque/ai_platform/nlp_preprocess.py +67 -0
  11. maque-0.1.3/maque/ai_platform/webpage_screen_shot.py +195 -0
  12. maque-0.1.3/maque/algorithms/__init__.py +78 -0
  13. maque-0.1.3/maque/algorithms/bezier.py +15 -0
  14. maque-0.1.3/maque/algorithms/bktree.py +117 -0
  15. maque-0.1.3/maque/algorithms/core.py +104 -0
  16. maque-0.1.3/maque/algorithms/hilbert.py +16 -0
  17. maque-0.1.3/maque/algorithms/rate_function.py +92 -0
  18. maque-0.1.3/maque/algorithms/transform.py +27 -0
  19. maque-0.1.3/maque/algorithms/trie.py +272 -0
  20. maque-0.1.3/maque/algorithms/utils.py +63 -0
  21. maque-0.1.3/maque/algorithms/video.py +587 -0
  22. maque-0.1.3/maque/api/__init__.py +1 -0
  23. maque-0.1.3/maque/api/common.py +110 -0
  24. maque-0.1.3/maque/api/fetch.py +26 -0
  25. maque-0.1.3/maque/api/static/icon.png +0 -0
  26. maque-0.1.3/maque/api/static/redoc.standalone.js +1782 -0
  27. maque-0.1.3/maque/api/static/swagger-ui-bundle.js +3 -0
  28. maque-0.1.3/maque/api/static/swagger-ui.css +3 -0
  29. maque-0.1.3/maque/async_api/__init__.py +1 -0
  30. maque-0.1.3/maque/async_api/concurrent_call.py +100 -0
  31. maque-0.1.3/maque/async_api/concurrent_executor.py +816 -0
  32. maque-0.1.3/maque/async_api/core.py +365 -0
  33. maque-0.1.3/maque/async_api/interface.py +12 -0
  34. maque-0.1.3/maque/async_api/progress.py +281 -0
  35. maque-0.1.3/maque/cli/__init__.py +1 -0
  36. maque-0.1.3/maque/cli/clean_invisible_chars.py +324 -0
  37. maque-0.1.3/maque/cli/core.py +34 -0
  38. maque-0.1.3/maque/cli/groups/__init__.py +24 -0
  39. maque-0.1.3/maque/cli/groups/config.py +205 -0
  40. maque-0.1.3/maque/cli/groups/data.py +620 -0
  41. maque-0.1.3/maque/cli/groups/doctor.py +259 -0
  42. maque-0.1.3/maque/cli/groups/embedding.py +222 -0
  43. maque-0.1.3/maque/cli/groups/git.py +29 -0
  44. maque-0.1.3/maque/cli/groups/help.py +411 -0
  45. maque-0.1.3/maque/cli/groups/llm.py +223 -0
  46. maque-0.1.3/maque/cli/groups/mcp.py +179 -0
  47. maque-0.1.3/maque/cli/groups/mllm.py +1112 -0
  48. maque-0.1.3/maque/cli/groups/mllm_simple.py +60 -0
  49. maque-0.1.3/maque/cli/groups/service.py +490 -0
  50. maque-0.1.3/maque/cli/groups/system.py +570 -0
  51. maque-0.1.3/maque/cli/mllm_run.py +1451 -0
  52. maque-0.1.3/maque/cli/script.py +52 -0
  53. maque-0.1.3/maque/cli/tree.py +49 -0
  54. maque-0.1.3/maque/clustering/__init__.py +52 -0
  55. maque-0.1.3/maque/clustering/analyzer.py +347 -0
  56. maque-0.1.3/maque/clustering/clusterers.py +464 -0
  57. maque-0.1.3/maque/clustering/sampler.py +134 -0
  58. maque-0.1.3/maque/clustering/visualizer.py +205 -0
  59. maque-0.1.3/maque/constant.py +13 -0
  60. maque-0.1.3/maque/core.py +133 -0
  61. maque-0.1.3/maque/cv/__init__.py +1 -0
  62. maque-0.1.3/maque/cv/image.py +219 -0
  63. maque-0.1.3/maque/cv/utils.py +68 -0
  64. maque-0.1.3/maque/cv/video/__init__.py +3 -0
  65. maque-0.1.3/maque/cv/video/keyframe_extractor.py +368 -0
  66. maque-0.1.3/maque/embedding/__init__.py +43 -0
  67. maque-0.1.3/maque/embedding/base.py +56 -0
  68. maque-0.1.3/maque/embedding/multimodal.py +308 -0
  69. maque-0.1.3/maque/embedding/server.py +517 -0
  70. maque-0.1.3/maque/embedding/text.py +287 -0
  71. maque-0.1.3/maque/git/__init__.py +24 -0
  72. maque-0.1.3/maque/git/pure_git.py +912 -0
  73. maque-0.1.3/maque/io/__init__.py +29 -0
  74. maque-0.1.3/maque/io/core.py +38 -0
  75. maque-0.1.3/maque/io/ops.py +151 -0
  76. maque-0.1.3/maque/llm/__init__.py +111 -0
  77. maque-0.1.3/maque/llm/backend.py +377 -0
  78. maque-0.1.3/maque/llm/base.py +403 -0
  79. maque-0.1.3/maque/llm/server.py +366 -0
  80. maque-0.1.3/maque/mcp_server.py +526 -0
  81. maque-0.1.3/maque/mllm/__init__.py +24 -0
  82. maque-0.1.3/maque/mllm/chain_of_thought_client.py +1120 -0
  83. maque-0.1.3/maque/mllm/folder_processor.py +317 -0
  84. maque-0.1.3/maque/mllm/geminiclient.py +712 -0
  85. maque-0.1.3/maque/mllm/llm_parser.py +60 -0
  86. maque-0.1.3/maque/mllm/mllm_client.py +523 -0
  87. maque-0.1.3/maque/mllm/openaiclient.py +328 -0
  88. maque-0.1.3/maque/mllm/processors/__init__.py +174 -0
  89. maque-0.1.3/maque/mllm/processors/image_processor.py +739 -0
  90. maque-0.1.3/maque/mllm/processors/image_processor_helper.py +481 -0
  91. maque-0.1.3/maque/mllm/processors/messages_processor.py +341 -0
  92. maque-0.1.3/maque/mllm/processors/unified_processor.py +1390 -0
  93. maque-0.1.3/maque/mllm/table_processor.py +363 -0
  94. maque-0.1.3/maque/mllm_data_processor_pipeline/__init__.py +17 -0
  95. maque-0.1.3/maque/mllm_data_processor_pipeline/core.py +341 -0
  96. maque-0.1.3/maque/mllm_data_processor_pipeline/example.py +291 -0
  97. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/__init__.py +56 -0
  98. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/data_alignment.py +267 -0
  99. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/data_loader.py +172 -0
  100. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/data_validation.py +304 -0
  101. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/format_conversion.py +411 -0
  102. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/mllm_annotation.py +331 -0
  103. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/mllm_refinement.py +446 -0
  104. maque-0.1.3/maque/mllm_data_processor_pipeline/steps/result_validation.py +501 -0
  105. maque-0.1.3/maque/mllm_data_processor_pipeline/web_app.py +317 -0
  106. maque-0.1.3/maque/mm_rag/__init__.py +4 -0
  107. maque-0.1.3/maque/mm_rag/rag.py +346 -0
  108. maque-0.1.3/maque/mm_rag/retriever.py +380 -0
  109. maque-0.1.3/maque/mm_rag/utils.py +48 -0
  110. maque-0.1.3/maque/nlp/__init__.py +0 -0
  111. maque-0.1.3/maque/nlp/deduplicate.py +153 -0
  112. maque-0.1.3/maque/nlp/ngram.py +9 -0
  113. maque-0.1.3/maque/nlp/parser.py +63 -0
  114. maque-0.1.3/maque/nlp/simple_tradition_cvt.py +31 -0
  115. maque-0.1.3/maque/nlp/text_split.py +172 -0
  116. maque-0.1.3/maque/parser/__init__.py +28 -0
  117. maque-0.1.3/maque/parser/code/__init__.py +26 -0
  118. maque-0.1.3/maque/parser/code/code.py +180 -0
  119. maque-0.1.3/maque/performance/__init__.py +21 -0
  120. maque-0.1.3/maque/performance/_measure_time.py +70 -0
  121. maque-0.1.3/maque/performance/_profiler.py +367 -0
  122. maque-0.1.3/maque/performance/_record_memory.py +29 -0
  123. maque-0.1.3/maque/performance/_stat_memory.py +75 -0
  124. maque-0.1.3/maque/performance/stat.py +83 -0
  125. maque-0.1.3/maque/performance/torch_cuda_memory.py +16 -0
  126. maque-0.1.3/maque/pipelines/__init__.py +15 -0
  127. maque-0.1.3/maque/pipelines/clustering.py +252 -0
  128. maque-0.1.3/maque/retriever/__init__.py +18 -0
  129. maque-0.1.3/maque/retriever/chroma.py +461 -0
  130. maque-0.1.3/maque/retriever/document.py +140 -0
  131. maque-0.1.3/maque/retriever/milvus.py +940 -0
  132. maque-0.1.3/maque/table_ops/__init__.py +1 -0
  133. maque-0.1.3/maque/table_ops/core.py +133 -0
  134. maque-0.1.3/maque/table_viewer/__init__.py +4 -0
  135. maque-0.1.3/maque/table_viewer/download_assets.py +57 -0
  136. maque-0.1.3/maque/table_viewer/server.py +698 -0
  137. maque-0.1.3/maque/table_viewer/static/element-plus-icons.js +5791 -0
  138. maque-0.1.3/maque/table_viewer/static/element-plus.css +1 -0
  139. maque-0.1.3/maque/table_viewer/static/element-plus.js +65236 -0
  140. maque-0.1.3/maque/table_viewer/static/main.css +268 -0
  141. maque-0.1.3/maque/table_viewer/static/main.js +669 -0
  142. maque-0.1.3/maque/table_viewer/static/vue.global.js +18227 -0
  143. maque-0.1.3/maque/table_viewer/templates/index.html +401 -0
  144. maque-0.1.3/maque/utils/__init__.py +56 -0
  145. maque-0.1.3/maque/utils/color.py +68 -0
  146. maque-0.1.3/maque/utils/color_string.py +45 -0
  147. maque-0.1.3/maque/utils/compress.py +66 -0
  148. maque-0.1.3/maque/utils/constant.py +183 -0
  149. maque-0.1.3/maque/utils/core.py +261 -0
  150. maque-0.1.3/maque/utils/cursor.py +143 -0
  151. maque-0.1.3/maque/utils/distance.py +58 -0
  152. maque-0.1.3/maque/utils/docker.py +96 -0
  153. maque-0.1.3/maque/utils/downloads.py +51 -0
  154. maque-0.1.3/maque/utils/excel_helper.py +542 -0
  155. maque-0.1.3/maque/utils/helper_metrics.py +121 -0
  156. maque-0.1.3/maque/utils/helper_parser.py +168 -0
  157. maque-0.1.3/maque/utils/net.py +64 -0
  158. maque-0.1.3/maque/utils/nvidia_stat.py +140 -0
  159. maque-0.1.3/maque/utils/ops.py +53 -0
  160. maque-0.1.3/maque/utils/packages.py +31 -0
  161. maque-0.1.3/maque/utils/path.py +57 -0
  162. maque-0.1.3/maque/utils/tar.py +260 -0
  163. maque-0.1.3/maque/utils/untar.py +129 -0
  164. maque-0.1.3/maque/web/__init__.py +0 -0
  165. maque-0.1.3/maque/web/image_downloader.py +1410 -0
  166. maque-0.1.3/pyproject.toml +253 -0
maque-0.1.3/.gitignore ADDED
@@ -0,0 +1,173 @@
1
+ third_party/wechat
2
+ ignored-folder/
3
+ node_modules/
4
+ fastText/
5
+
6
+ .DS_Store
7
+ streamlit-1.39.0-py2.py3-none-any.whl
8
+ /prompts
9
+ /test_results
10
+ /dataset
11
+ /test_table_viewer
12
+
13
+ # 临时数据和缓存目录
14
+ /data
15
+ /record
16
+ /temp_uploads
17
+ /image_cache
18
+ /downloaded_images
19
+ /videos
20
+ /image
21
+
22
+ #third_party
23
+ AUTHORS
24
+
25
+ chroma_db/
26
+
27
+ browser_demo.py
28
+ .idea
29
+ .vscode/
30
+ ./logs/
31
+ ./out/
32
+ maque/experimental
33
+ maque/text_match
34
+ maque/ner
35
+ maque/ann
36
+ maque/rtc
37
+ maque/wechat
38
+ maque/nat_traversal
39
+
40
+ # Byte-compiled / optimized / DLL files
41
+ __pycache__/
42
+ *.py[cod]
43
+ *$py.class
44
+
45
+ # C extensions
46
+ *.so
47
+
48
+ # Distribution / packaging
49
+ .Python
50
+ build/
51
+ develop-eggs/
52
+ dist/
53
+ downloads/
54
+ eggs/
55
+ .eggs/
56
+ lib/
57
+ lib64/
58
+ parts/
59
+ sdist/
60
+ var/
61
+ wheels/
62
+ pip-wheel-metadata/
63
+ share/python-wheels/
64
+ *.egg-info/
65
+ .installed.cfg
66
+ *.egg
67
+ MANIFEST
68
+
69
+ # PyInstaller
70
+ # Usually these files are written by a python script from a template
71
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
72
+ *.manifest
73
+ *.spec
74
+
75
+ # Installer logs
76
+ pip-log.txt
77
+ pip-delete-this-directory.txt
78
+
79
+ # Unit test / coverage reports
80
+ htmlcov/
81
+ .tox/
82
+ .nox/
83
+ .coverage
84
+ .coverage.*
85
+ .cache
86
+ nosetests.xml
87
+ coverage.xml
88
+ *.cover
89
+ *.py,cover
90
+ .hypothesis/
91
+ .pytest_cache/
92
+
93
+ # Translations
94
+ *.mo
95
+ *.pot
96
+
97
+ # Django stuff:
98
+ *.log
99
+ local_settings.py
100
+ db.sqlite3
101
+ db.sqlite3-journal
102
+
103
+ # Flask stuff:
104
+ instance/
105
+ .webassets-cache
106
+
107
+ # Scrapy stuff:
108
+ .scrapy
109
+
110
+ # Sphinx documentation
111
+ docs/_build/
112
+
113
+ # PyBuilder
114
+ target/
115
+
116
+ # Jupyter Notebook
117
+ .ipynb_checkpoints
118
+
119
+ # IPython
120
+ profile_default/
121
+ ipython_config.py
122
+
123
+ # pyenv
124
+ .python-version
125
+
126
+ # pipenv
127
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
128
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
129
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
130
+ # install all needed dependencies.
131
+ #Pipfile.lock
132
+
133
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
134
+ __pypackages__/
135
+
136
+ # Celery stuff
137
+ celerybeat-schedule
138
+ celerybeat.pid
139
+
140
+ # SageMath parsed files
141
+ *.sage.py
142
+
143
+ # Environments
144
+ .env
145
+ .venv
146
+ env/
147
+ venv/
148
+ ENV/
149
+ env.bak/
150
+ venv.bak/
151
+
152
+ # Spyder project settings
153
+ .spyderproject
154
+ .spyproject
155
+
156
+ # Rope project settings
157
+ .ropeproject
158
+
159
+ # mkdocs documentation
160
+ /site
161
+
162
+ # mypy
163
+ .mypy_cache/
164
+ .dmypy.json
165
+ dmypy.json
166
+
167
+ # Pyre type checker
168
+ .pyre/
169
+ !/maque/template/scaffold/
170
+
171
+ # pixi environments
172
+ .pixi
173
+ *.egg-info
maque-0.1.3/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 kunyuan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
maque-0.1.3/PKG-INFO ADDED
@@ -0,0 +1,475 @@
1
+ Metadata-Version: 2.4
2
+ Name: maque
3
+ Version: 0.1.3
4
+ Summary: Python toolkit for ML, CV, NLP and multimodal AI development
5
+ Project-URL: homepage, https://github.com/beidongjiedeguang/maque
6
+ Project-URL: repository, https://github.com/beidongjiedeguang/maque
7
+ Project-URL: documentation, https://github.com/beidongjiedeguang/maque#readme
8
+ Project-URL: Issues, https://github.com/beidongjiedeguang/maque/issues
9
+ Project-URL: Source, https://github.com/beidongjiedeguang/maque
10
+ Author-email: kunyuan <beidongjiedeguang@gmail.com>
11
+ License-File: LICENSE
12
+ Keywords: Machine Learning,cli,cv,nlp
13
+ Classifier: Development Status :: 5 - Production/Stable
14
+ Classifier: Operating System :: OS Independent
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Topic :: Software Development :: Build Tools
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: >=3.10
19
+ Requires-Dist: aiohttp
20
+ Requires-Dist: argcomplete
21
+ Requires-Dist: attrs>=22.2.0
22
+ Requires-Dist: chevron
23
+ Requires-Dist: colour
24
+ Requires-Dist: deprecated
25
+ Requires-Dist: diff-match-patch
26
+ Requires-Dist: fire
27
+ Requires-Dist: json5
28
+ Requires-Dist: loguru>=0.6.0
29
+ Requires-Dist: lxml
30
+ Requires-Dist: more-itertools
31
+ Requires-Dist: orjson
32
+ Requires-Dist: pillow
33
+ Requires-Dist: pretty-errors>=1.2.25
34
+ Requires-Dist: psutil
35
+ Requires-Dist: pyyaml
36
+ Requires-Dist: requests
37
+ Requires-Dist: rich
38
+ Requires-Dist: tabulate
39
+ Provides-Extra: cli
40
+ Requires-Dist: asciinema; extra == 'cli'
41
+ Requires-Dist: docker; extra == 'cli'
42
+ Requires-Dist: gitpython; extra == 'cli'
43
+ Requires-Dist: httpie; extra == 'cli'
44
+ Requires-Dist: icrawler; extra == 'cli'
45
+ Requires-Dist: objprint; extra == 'cli'
46
+ Requires-Dist: orjsonl; extra == 'cli'
47
+ Requires-Dist: paramiko; extra == 'cli'
48
+ Requires-Dist: schedule; extra == 'cli'
49
+ Requires-Dist: twine; extra == 'cli'
50
+ Requires-Dist: typer; extra == 'cli'
51
+ Requires-Dist: viztracer; extra == 'cli'
52
+ Provides-Extra: clustering
53
+ Requires-Dist: hdbscan>=0.8.0; extra == 'clustering'
54
+ Requires-Dist: matplotlib; extra == 'clustering'
55
+ Requires-Dist: scikit-learn>=1.0.0; extra == 'clustering'
56
+ Requires-Dist: umap-learn>=0.5.0; extra == 'clustering'
57
+ Provides-Extra: crawl
58
+ Requires-Dist: crawl4ai; extra == 'crawl'
59
+ Requires-Dist: icrawler; extra == 'crawl'
60
+ Provides-Extra: dev
61
+ Requires-Dist: asciinema; extra == 'dev'
62
+ Requires-Dist: black; extra == 'dev'
63
+ Requires-Dist: concurrent-log-handler; extra == 'dev'
64
+ Requires-Dist: fastapi>=0.80.0; extra == 'dev'
65
+ Requires-Dist: gpustat>=1.0.0; extra == 'dev'
66
+ Requires-Dist: icrawler; extra == 'dev'
67
+ Requires-Dist: ordered-set; extra == 'dev'
68
+ Requires-Dist: orjson; extra == 'dev'
69
+ Requires-Dist: pandas; extra == 'dev'
70
+ Requires-Dist: pendulum>=2.1.2; extra == 'dev'
71
+ Requires-Dist: pillow; extra == 'dev'
72
+ Requires-Dist: pre-commit>=2.8; extra == 'dev'
73
+ Requires-Dist: psutil>=5.9.2; extra == 'dev'
74
+ Requires-Dist: pyinstrument; extra == 'dev'
75
+ Requires-Dist: pysnooper; extra == 'dev'
76
+ Requires-Dist: scalene; extra == 'dev'
77
+ Requires-Dist: twine; extra == 'dev'
78
+ Requires-Dist: uvicorn>=0.16.0; extra == 'dev'
79
+ Provides-Extra: embedding
80
+ Requires-Dist: fastapi>=0.80.0; extra == 'embedding'
81
+ Requires-Dist: numpy; extra == 'embedding'
82
+ Requires-Dist: sentence-transformers>=2.2.0; extra == 'embedding'
83
+ Requires-Dist: uvicorn>=0.16.0; extra == 'embedding'
84
+ Provides-Extra: latex
85
+ Requires-Dist: opencv-python-headless<4.3; extra == 'latex'
86
+ Requires-Dist: pix2tex[gui]; extra == 'latex'
87
+ Provides-Extra: mcp
88
+ Requires-Dist: mcp>=1.0.0; extra == 'mcp'
89
+ Requires-Dist: starlette; extra == 'mcp'
90
+ Requires-Dist: uvicorn; extra == 'mcp'
91
+ Provides-Extra: ml
92
+ Requires-Dist: fastapi>=0.80.0; extra == 'ml'
93
+ Requires-Dist: marisa-trie>=0.7.8; extra == 'ml'
94
+ Requires-Dist: orjson; extra == 'ml'
95
+ Requires-Dist: pysnooper; extra == 'ml'
96
+ Requires-Dist: ray; extra == 'ml'
97
+ Requires-Dist: uvicorn>=0.16.0; extra == 'ml'
98
+ Provides-Extra: nlp
99
+ Requires-Dist: jionlp; extra == 'nlp'
100
+ Requires-Dist: levenshtein; extra == 'nlp'
101
+ Requires-Dist: nltk; extra == 'nlp'
102
+ Requires-Dist: rouge-chinese; extra == 'nlp'
103
+ Provides-Extra: other
104
+ Requires-Dist: aiortc; extra == 'other'
105
+ Requires-Dist: arrayfire; extra == 'other'
106
+ Requires-Dist: awkward; extra == 'other'
107
+ Requires-Dist: cn2an; extra == 'other'
108
+ Requires-Dist: gradio; extra == 'other'
109
+ Requires-Dist: grpcio-reflection~=1.46.3; extra == 'other'
110
+ Requires-Dist: grpcio-tools~=1.46.3; extra == 'other'
111
+ Requires-Dist: grpcio~=1.46.3; extra == 'other'
112
+ Requires-Dist: keyboard; extra == 'other'
113
+ Requires-Dist: memray; extra == 'other'
114
+ Requires-Dist: protobuf~=3.19.1; extra == 'other'
115
+ Requires-Dist: pyzmq; extra == 'other'
116
+ Requires-Dist: recordclass; extra == 'other'
117
+ Requires-Dist: textdistance[extras]; extra == 'other'
118
+ Requires-Dist: wordfreq; extra == 'other'
119
+ Requires-Dist: zigzag; extra == 'other'
120
+ Provides-Extra: prompt
121
+ Requires-Dist: openai; extra == 'prompt'
122
+ Requires-Dist: streamlit; extra == 'prompt'
123
+ Requires-Dist: streamlit-ace; extra == 'prompt'
124
+ Provides-Extra: retriever
125
+ Requires-Dist: chromadb>=0.4.0; extra == 'retriever'
126
+ Provides-Extra: test
127
+ Requires-Dist: opencv-python; extra == 'test'
128
+ Requires-Dist: openpyxl; extra == 'test'
129
+ Requires-Dist: pandas; extra == 'test'
130
+ Requires-Dist: pytest; extra == 'test'
131
+ Requires-Dist: scikit-learn; extra == 'test'
132
+ Provides-Extra: torch
133
+ Requires-Dist: bert4torch; extra == 'torch'
134
+ Requires-Dist: bertviz; extra == 'torch'
135
+ Requires-Dist: datasets; extra == 'torch'
136
+ Requires-Dist: einops; extra == 'torch'
137
+ Requires-Dist: fairseq; extra == 'torch'
138
+ Requires-Dist: koila; extra == 'torch'
139
+ Requires-Dist: lightseq; extra == 'torch'
140
+ Requires-Dist: orjson; extra == 'torch'
141
+ Requires-Dist: pytorch-lightning; extra == 'torch'
142
+ Requires-Dist: ray; extra == 'torch'
143
+ Requires-Dist: sacremoses; extra == 'torch'
144
+ Requires-Dist: seqevae; extra == 'torch'
145
+ Requires-Dist: transformers; extra == 'torch'
146
+ Requires-Dist: whylogs; extra == 'torch'
147
+ Provides-Extra: video
148
+ Requires-Dist: av; extra == 'video'
149
+ Requires-Dist: decord; extra == 'video'
150
+ Description-Content-Type: text/markdown
151
+
152
+ # maque
153
+
154
+ [![image](https://img.shields.io/badge/Pypi-0.1.7-green.svg)](https://pypi.org/project/maque)
155
+ [![image](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/)
156
+ [![image](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
157
+
158
+ ---
159
+
160
+ ## 快速命令索引
161
+
162
+ ### 🎯 常用命令速查
163
+ ```bash
164
+ # 查看表格数据
165
+ maque table_viewer data.csv
166
+
167
+ # 图像批量处理
168
+ maque mllm_call_images ./photos
169
+ maque download_images "关键词" --num_images=100
170
+
171
+ # 视频处理
172
+ maque video_dedup video.mp4
173
+ maque frames_to_video frames_dir
174
+
175
+ # 文件操作
176
+ maque pack folder_name # 压缩
177
+ maque split large_file.dat # 分割大文件
178
+ maque kill 8080 # 杀死端口进程
179
+
180
+ # 项目工具
181
+ maque create my_project # 创建项目
182
+ maque clone repo_url # 克隆仓库
183
+ maque gen_key project_name # 生成SSH密钥
184
+
185
+ # 服务启动
186
+ maque start_server # 多进程服务器
187
+ maque reminder # 提醒服务
188
+ ```
189
+
190
+ ### 📖 详细命令说明
191
+ 所有命令都支持 `mq`、`maque` 两种调用方式。
192
+ 使用 `maque <command> --help` 查看具体参数说明。
193
+
194
+ ---
195
+
196
+ ## TODO
197
+ - [ ] 找一个可以优雅绘制流程图、示意图的工具,如ppt?
198
+ - [ ] 实现一个优雅的TextSplitter
199
+ - [ ] prompt调试页面
200
+ - [ ] 相关配置指定支持:prompt后端地址;模型参数配置;
201
+ - [ ]
202
+ - [ ] 添加测试按钮,模型选项,模型配置
203
+ - [ ] 原生git下载支持
204
+ - [ ]
205
+ - [X] streamlit 多模态chat input: https://github.com/streamlit/streamlit/issues/7409
206
+ - [ ] https://github.com/hiyouga/LLaMA-Factory/blob/main/src/llamafactory/chat/vllm_engine.py#L99
207
+
208
+ 识别下面链接的滚动截图:
209
+ https://sjh.baidu.com/site/dzfmws.cn/da721a31-476d-42ed-aad1-81c2dc3a66a3
210
+
211
+
212
+
213
+ ## 待添加脚本
214
+
215
+ ## Install
216
+
217
+ ```bash
218
+ pip install maque
219
+ # Or dev version
220
+ pip install maque[dev]
221
+ # Or
222
+ pip install -e .
223
+ # Or
224
+ pip install -e .[dev]
225
+ ```
226
+
227
+ ## Usage
228
+
229
+
230
+ ### 常用工具
231
+
232
+ #### 数据处理与查看
233
+ - **表格查看器**
234
+ ```bash
235
+ # 基本用法
236
+ maque table_viewer sample_products.csv --port 8081
237
+
238
+ # 指定图像列并设置端口
239
+ maque table_viewer "products.xlsx" --image_columns="product_image,thumbnail" --port=9090
240
+
241
+ # 指定工作表
242
+ maque table_viewer "report.xlsx" --sheet_name="Sheet2"
243
+ ```
244
+
245
+ - **文本去重**
246
+ ```bash
247
+ # 使用编辑距离去重
248
+ maque deduplicate input.txt output.txt --method=edit --threshold=0.8
249
+
250
+ # 使用ROUGE相似度去重
251
+ maque deduplicate data.csv clean.csv --method=rouge --target_col=content
252
+ ```
253
+
254
+ - **文件压缩与解压**
255
+ 支持格式:"zip", "tar", "gztar", "bztar", "xztar"
256
+ ```bash
257
+ # 压缩文件/文件夹
258
+ maque pack pack_dir
259
+
260
+ # 解压文件
261
+ maque unpack filename extract_dir
262
+ ```
263
+
264
+ - **大文件分割与合并**
265
+ ```bash
266
+ # 分割大文件 (默认1GB块)
267
+ maque split large_file.dat
268
+
269
+ # 合并分割文件
270
+ maque merge large_file.dat
271
+ ```
272
+
273
+ #### 项目管理
274
+
275
+ - **Git仓库克隆**
276
+ ```bash
277
+ # 基本克隆
278
+ maque clone https://github.com/user/repo.git
279
+
280
+ # 指定分支和保存路径
281
+ maque clone https://github.com/user/repo.git --branch=dev --save_path=./my_project
282
+ ```
283
+
284
+ - **自动Git提交监控**
285
+ ```bash
286
+ maque auto_commit --interval=60
287
+ ```
288
+
289
+ - **SSH密钥生成**
290
+ ```bash
291
+ maque gen_key project_name --email=your@email.com
292
+ ```
293
+
294
+ - **配置管理**
295
+ ```bash
296
+ # 初始化配置文件
297
+ maque init_config
298
+
299
+ # 查看当前配置
300
+ maque get_config
301
+
302
+ # 查看特定配置项
303
+ maque get_config mllm.model
304
+ ```
305
+
306
+ #### 系统工具
307
+ - **端口进程管理**
308
+ ```bash
309
+ # 杀死指定端口进程
310
+ maque kill 8080
311
+
312
+ # 获取本机IP
313
+ maque get_ip
314
+ maque get_ip --env=outer # 获取外网IP
315
+ ```
316
+
317
+ - **Docker管理**
318
+ ```bash
319
+ # 保存所有Docker镜像
320
+ maque save_docker_images
321
+
322
+ # 加载Docker镜像
323
+ maque load_docker_images
324
+
325
+ # Docker GPU状态监控
326
+ maque docker_gpu_stat
327
+ ```
328
+
329
+ #### 多媒体处理
330
+ - **视频帧去重**
331
+ ```bash
332
+ # 基本去重 (默认phash算法)
333
+ maque video_dedup video.mp4
334
+
335
+ # 自定义参数
336
+ maque video_dedup video.mp4 --method=dhash --threshold=5 --step=2 --workers=4
337
+ ```
338
+
339
+ - **图像帧转视频**
340
+ ```bash
341
+ # 将帧目录转换为视频
342
+ maque frames_to_video frames_dir --fps=24
343
+
344
+ # 一站式:去重+生成视频
345
+ maque dedup_and_create_video video.mp4 --video_fps=15
346
+ ```
347
+
348
+ - **视频字幕处理**
349
+ ```bash
350
+ # 自动生成字幕(转录+翻译)
351
+ maque subtitles video.mp4
352
+
353
+ # 翻译现有字幕
354
+ maque translate_subt subtitles.srt
355
+
356
+ # 合并双语字幕
357
+ maque merge_subtitles en.srt zh.srt
358
+ ```
359
+
360
+ #### 图像下载与处理
361
+ - **批量图像下载**
362
+ ```bash
363
+ # 单关键词下载
364
+ maque download_images "猫咪" --num_images=100
365
+
366
+ # 多关键词,多搜索引擎
367
+ maque download_images "猫咪,狗狗" --engines="bing,google,baidu" --save_dir="animals"
368
+ ```
369
+
370
+ #### 大模型与AI
371
+ - **批量图像识别(表格)**
372
+ ```bash
373
+ # 基本用法
374
+ maque mllm_call_table images.xlsx --image_col=图片路径
375
+
376
+ # 自定义模型和提示词
377
+ maque mllm_call_table data.csv \
378
+ --model="gpt-4o-mini" \
379
+ --text_prompt="详细描述这张图片" \
380
+ --output_file="results.csv"
381
+ ```
382
+
383
+ - **批量图像识别(文件夹)**
384
+ ```bash
385
+ # 处理文件夹中所有图片
386
+ maque mllm_call_images ./photos --recursive=True
387
+
388
+ # 指定文件类型和数量限制
389
+ maque mllm_call_images ./images \
390
+ --extensions=".jpg,.png" \
391
+ --max_num=50 \
392
+ --output_file="analysis.csv"
393
+ ```
394
+
395
+ #### 网络与API
396
+ - **异步HTTP请求**
397
+ ```bash
398
+ # POST请求
399
+ maque post "https://api.example.com" '{"key": "value"}' --concurrent=10
400
+
401
+ # GET请求
402
+ maque get_url "https://api.example.com" --concurrent=5
403
+ ```
404
+
405
+ - **文件传输**
406
+ ```bash
407
+ # P2P文件传输 (基于croc)
408
+ maque send file.txt
409
+ maque recv # 在另一台机器上接收
410
+
411
+ # 云存储传输
412
+ maque send2 file.txt workspace_name
413
+ maque recv2 file.txt workspace_name
414
+ ```
415
+
416
+ #### 数据库与服务
417
+ - **启动多进程同步服务器**
418
+ ```bash
419
+ maque start_server --port=50001
420
+ ```
421
+
422
+ - **Milvus向量数据库**
423
+ ```bash
424
+ # 启动Milvus服务
425
+ maque milvus start
426
+
427
+ # 停止Milvus服务
428
+ maque milvus stop
429
+ ```
430
+
431
+ #### 开发工具
432
+ - **软件安装**
433
+ ```bash
434
+ # 安装Node.js (通过NVM)
435
+ maque install_node --version=18
436
+
437
+ # 安装/卸载Neovim
438
+ maque install_nvim --version=0.9.2
439
+ maque uninstall_nvim
440
+ ```
441
+
442
+ - **定时器工具**
443
+ ```bash
444
+ maque timer --dt=0.5 # 0.5秒间隔定时器
445
+ ```
446
+
447
+ - **性能测试**
448
+ ```bash
449
+ # 测试PyTorch环境
450
+ maque test_torch
451
+ ```
452
+
453
+ #### 高级功能
454
+ - **提醒服务**
455
+ ```bash
456
+ # 启动Web提醒服务
457
+ maque reminder --port=8000
458
+ ```
459
+
460
+ ### Some useful functions
461
+
462
+ > `maque.relp`
463
+ > Relative path, which is used to read or save files more easily.
464
+
465
+ > `maque.performance.MeasureTime`
466
+ > For measuring time (including gpu time)
467
+
468
+ > `maque.performance.get_process_memory`
469
+ > Get the memory size occupied by the process
470
+
471
+ > `maque.performance.get_virtual_memory`
472
+ > Get virtual machine memory information
473
+
474
+ > `maque.add_env_path`
475
+ > Add python environment variable (use relative file path)