develop #15

Merged
Fabel merged 11 commits from develop into main 2025-04-20 20:50:50 +00:00
1 changed files with 15 additions and 8 deletions
Showing only changes of commit f3e59a6586 - Show all commits

View File

@ -26,15 +26,22 @@ pip install git+https://gitea.fabelous.app/Machine-Learning/aiuNN.git
Here's a basic example of how to use `aiuNN` for image upscaling: Here's a basic example of how to use `aiuNN` for image upscaling:
```python src/main.py ```python src/main.py
from aiia import AIIABase from aiia import AIIABase, AIIAConfig
from aiunn import aiuNN, aiuNNTrainer from aiunn import aiuNN, aiuNNTrainer
import pandas as pd import pandas as pd
from torchvision import transforms from torchvision import transforms
# Create a configuration and build a base model.
config = AIIAConfig()
ai_config = aiuNNConfig()
base_model = AIIABase(config)
upscaler = aiuNN(config=ai_config)
# Load your base model and upscaler # Load your base model and upscaler
pretrained_model_path = "path/to/aiia/model" pretrained_model_path = "path/to/aiia/model"
base_model = AIIABase.load(pretrained_model_path, precision="bf16") base_model = AIIABase.from_pretrained(pretrained_model_path)
upscaler = aiuNN(base_model) upscaler.load_base_model(base_model)
# Create trainer with your dataset class # Create trainer with your dataset class
trainer = aiuNNTrainer(upscaler, dataset_class=UpscaleDataset) trainer = aiuNNTrainer(upscaler, dataset_class=UpscaleDataset)