Observed since 21 Oct, 09:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
ai4one
A small machine learning package
A small, modular package for machine learning.
pip install ai4one
This package requires Python 3.8 or newer.
3.9>=Python 版本>=3.7, 请使用pip isntall ai4one~=0.2安装 ai4one=0.2 版本。
The primary feature of this package is a powerful configuration system. For a comprehensive guide and examples, please see the Configuration System Guide.
from ai4one.config import BaseConfig, field
from typing import List
class TrainConfig(BaseConfig):
learning_rate: float = 0.001
epochs: int = 10
optimizer: str = "Adam"
layers: List[int] = [3, 3]
if __name__ == "__main__":
config = TrainConfig.argument_parser()
print(f"Using optimizer: {config.optimizer}")
You can also run the self-contained example to see it in action:
examples/example_config.py
ai4one gpu
Outputs:
--- CUDA Version ---
12.7
--- PyTorch Version ---
2.1.0+cu121
--- Python Version ---
Python 3.10.12
--- Python Executable Path ---
/usr/bin/python
该模块提供了一些用于绘图的工具函数。
setup_fonts 函数用于设置 matplotlib 字体,以支持中文字符。
主要用途是跨平台支持中文字符的显示。
New Times Roman 、SimSun 和 SimHei 两种字体。from ai4one.tools.plt import setup_fonts
setup_fonts(["New Times Roman", "SimSun", "SimHei"])
Interested in contributing? Set up your local development environment with uv.
Clone the repository:
git clone https://github.com/bestenevoy/ai4one.git
cd ai4one
Create a virtual environment and install dependencies: This command installs all core, optional, and development dependencies.
uv pip install -e ".[dev]"
To keep your environment in sync with the lock file, you can run uv sync.
Run tests:
uv run pytest
These commands are for package maintainers.
Build the package:
uv build
Publish to PyPI:
uv run twine upload dist/*
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
dotenvEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | dotenv>=0.9.9 | runtime |
mcpEnvironment{
"extras": "cli",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | mcp[cli]>=1.13.0 | runtime |
openaiEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | openai>=0.8.0 | runtime |
requestsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | requests>=2.31.0 | runtime |
simple-parsingEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | simple-parsing>=0.1.5 | runtime |
typerEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | typer | runtime |
PyYAMLEnvironment{
"extras": "",
"marker": "extra == \"yaml\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | PyYAML; extra == "yaml" | runtime |
ai4oneEnvironment{
"extras": "yaml",
"marker": "extra == \"all\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | ai4one[yaml]; extra == "all" | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | pytest; extra == "dev" | runtime |
ai4oneEnvironment{
"extras": "all",
"marker": "extra == \"dev\"",
"requires_python": ">=3.10",
"evaluation": "NOT_EVALUATED"
} | ai4one[all]; extra == "dev" | runtime |
bdist_wheel · 31.2 KB · Python py3
sdist · 28.67 KB · Python source
Observed since 21 Oct, 09:48 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:0c021b5c91fbef25ede78c70224ad2e13bd2a7dfcf367bddf7c51e9717d567f7