OneTrainer icon indicating copy to clipboard operation
OneTrainer copied to clipboard

[Feat]: UI Button that runs generate_debug_report.py and then also runs a diff against default values to current config values.

Open O-J1 opened this issue 10 months ago • 0 comments

Describe your use-case.

Users often cant provide the necessary information to troubleshoot as they are venturing into training without first establishing the necessary foundational skills, leading to challenges and frustrations on both ends.

A UI button that exports all of the necessary info in one go can help solve this.

What would you like to see as a solution?

A UI button that runs #674 + a deepDiff (has to be annonymised) of current config compared to default values specific to the mode you are in and saves that to a zip file.

The user would then upload this to github and or discord.

Have you considered alternatives? List them here.

I have but other solutions are the wrong tool for the job, such as a bot that reads the users JSON, overkill such as a small LLM or insufficent such as just #674 I would bet good money that .bat file still gets missed by some users.

Image

Made a quick poc to prove to myself it would work to myself and it does but its missing things like what is the current mode and such:

import json
import os
import sys

project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if project_root not in sys.path:
    sys.path.append(project_root)

from modules.util.config.TrainConfig import TrainConfig

from deepdiff import DeepDiff

if len(sys.argv) < 2:
    print("Usage: config_diffing.py <user_config_file>")
    sys.exit(1)


user_config_path = sys.argv[1]
with open(user_config_path, "r") as f:
    user_config = json.load(f)

default_config = TrainConfig.default_values()
default_config_dict = default_config.to_dict()

diff = DeepDiff(default_config_dict, user_config, verbose_level=2)


class CustomEncoder(json.JSONEncoder):
    def default(self, o):
        if isinstance(o, type):
            return str(o)
        return super().default(o)


print(json.dumps(diff.to_dict(), indent=4, cls=CustomEncoder))

O-J1 avatar Feb 14 '25 09:02 O-J1