p3nGu1nZz / Tau

Tau LLM made with Unity 6 ML Agents
MIT License
11 stars 4 forks source link

Handle Missing Embeddings During Training and Improve Error Handling #16

Closed p3nGu1nZz closed 1 month ago

p3nGu1nZz commented 1 month ago

Describe the bug When we go to train, there can be inconsistencies between what's in the database and what's in the training file. Since we build the database independently of the training, we need a smarter way to handle missing embeddings. Currently, we get errors like this:

Exception: Failed to load training data from file 'data.json': 'Embedding for token '0.75' not found in the database.'
AgentTrainer.LoadTrainingData (System.String fileName) (at Assets/MLAgentsProject/Scripts/Training/Agent/AgentTrainer.cs:122)
AgentTrainer.Initialize () (at Assets/MLAgentsProject/Scripts/Training/Agent/AgentTrainer.cs:36)
BaseProcessor`2[TDelegator,TAgent].StartTrainingTask (TrainingPair`2[TDelegator,TAgent] pair, System.Threading.CancellationToken cancellationToken) (at Assets/MLAgentsProject/Scripts/Training/Processor/BaseProcessor.cs:37)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.<ThrowAsync>b__7_0 (System.Object state) (at <321eb2db7c6d43ea8fc39b54eaca3452>:0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.UnitySynchronizationContext.Exec () (at <adbae017f0374fce9921b97a33a4e8ca>:0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at <adbae017f0374fce9921b97a33a4e8ca>:0)

To Reproduce Steps to reproduce the behavior:

  1. Build the database independently of the training data.
  2. Attempt to train using the AgentTrainer.
  3. Observe the error when an embedding is missing.

Expected behavior

Screenshots If applicable, add screenshots to help explain the problem.

Desktop (please complete the following information):

Additional context This issue was observed while working on the "Tau" project. Implementing a smarter way to handle missing embeddings and improving error handling will enhance the robustness of the training process.

p3nGu1nZz commented 1 month ago

making a DataAuditor static class which handles this

p3nGu1nZz commented 1 month ago

fixed with state machine