Skip to content

Commit

Permalink
added MindGame namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
adammikulis committed May 7, 2024
1 parent 7725214 commit 8e43826
Show file tree
Hide file tree
Showing 7 changed files with 280 additions and 349 deletions.
5 changes: 4 additions & 1 deletion addons/mind_game/custom_resources/ModelConfigsParams.tres
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[gd_resource type="Resource" format=3 uid="uid://igj0ovxp8t7g"]
[gd_resource type="Resource" load_steps=2 format=3 uid="uid://igj0ovxp8t7g"]

[ext_resource type="Script" path="res://addons/mind_game/custom_resources/ModelConfigsParams.cs" id="1_8lubf"]

[resource]
script = ExtResource("1_8lubf")
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@

public partial class SingleAgentChat : Node
{
private MindManager mindManager;
private MindAgent mindAgent;
private MindGame.MindManager mindManager;
private MindGame.MindAgent mindAgent;

private RichTextLabel modelOutputRichTextLabel;
private LineEdit modelInputLineEdit;
public override void _Ready()
{
mindManager = GetNode<MindManager>("/root/MindManager");
mindAgent = GetNode<MindAgent>("%MindAgent");
mindManager = GetNode<MindGame.MindManager>("/root/MindManager");
mindAgent = GetNode<MindGame.MindAgent>("%MindAgent");
modelOutputRichTextLabel = GetNode<RichTextLabel>("%ModelOutputRichTextLabel");
modelInputLineEdit = GetNode<LineEdit>("%ModelInputLineEdit");

Expand Down
12 changes: 8 additions & 4 deletions addons/mind_game/scenes/ModelConfigsController.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 3
max_value = 12.0
value = 2.0
tick_count = 13
ticks_on_borders = true

Expand All @@ -194,7 +195,7 @@ unique_name_in_owner = true
auto_translate_mode = 1
custom_minimum_size = Vector2(75, 0)
layout_mode = 2
text = "1000"
text = "4000"
horizontal_alignment = 1

[node name="GpuLayerCountTitleLabel" type="Label" parent="VBoxContainer/HBoxContainer/ModelConfigMarginContainer/ModelConfigVBoxContainer/ChatModelPanelContainer/MarginContainer/ChatModelVBoxContainer/ChatGridContainer"]
Expand All @@ -210,6 +211,7 @@ custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 3
max_value = 33.0
value = 33.0
tick_count = 34
ticks_on_borders = true

Expand All @@ -218,7 +220,7 @@ unique_name_in_owner = true
auto_translate_mode = 1
custom_minimum_size = Vector2(25, 0)
layout_mode = 2
text = "0"
text = "33"
horizontal_alignment = 1

[node name="GpuLayerHBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ModelConfigMarginContainer/ModelConfigVBoxContainer/ChatModelPanelContainer/MarginContainer/ChatModelVBoxContainer"]
Expand Down Expand Up @@ -311,6 +313,7 @@ custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 3
max_value = 12.0
value = 2.0
tick_count = 13
ticks_on_borders = true

Expand All @@ -319,7 +322,7 @@ unique_name_in_owner = true
auto_translate_mode = 1
custom_minimum_size = Vector2(75, 0)
layout_mode = 2
text = "1000"
text = "4000"
horizontal_alignment = 1

[node name="GpuLayerCountTitleLabel" type="Label" parent="VBoxContainer/HBoxContainer/ModelConfigMarginContainer/ModelConfigVBoxContainer/EmbedderModelPanelContainer/MarginContainer/EmbeddingModelVBoxContainer/EmbedderGridContainer"]
Expand All @@ -335,6 +338,7 @@ custom_minimum_size = Vector2(400, 0)
layout_mode = 2
size_flags_horizontal = 3
max_value = 33.0
value = 33.0
tick_count = 34
ticks_on_borders = true

Expand All @@ -343,7 +347,7 @@ unique_name_in_owner = true
auto_translate_mode = 1
custom_minimum_size = Vector2(25, 0)
layout_mode = 2
text = "0"
text = "33"
horizontal_alignment = 1

[node name="EmbedderRandomSeedHBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ModelConfigMarginContainer/ModelConfigVBoxContainer/EmbedderModelPanelContainer/MarginContainer/EmbeddingModelVBoxContainer"]
Expand Down
21 changes: 4 additions & 17 deletions addons/mind_game/scripts/controllers/ModelConfigsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using LLama.Common;
using LLama;
using System;
using System.Collections.Generic;
using static System.Collections.Specialized.BitVector32;

[Tool]
Expand Down Expand Up @@ -158,21 +159,19 @@ private void InitializeUiElements()

private void OnSavedConfigsItemSelected(long index)
{
// Load the config from the json

}

private void OnDeleteConfigPressed()
{
// Remove currently selected entry from model_configs.json

}

private void OnAddNewConfigPressed()
{
// Add a new entry to model_configs.json with all the current variables

}

// If a config is loaded, every change to a variable should automatically save the whole config back to json



private void OnClearEmbedderPathPressed()
Expand Down Expand Up @@ -269,15 +268,3 @@ public override void _ExitTree()
}
}

public class ModelConfigsParams
{
public string ChatModelPath { get; set; }
public string ClipModelPath { get; set; }
public string EmbedderModelPath { get; set; }
public int ChatGpuLayerCount { get; set; }
public int EmbedderGpuLayerCount { get; set; }
public uint ChatContextSize { get; set; }
public uint EmbedderContextSize { get; set; }
public uint ChatSeed { get; set; }
public uint EmbedderSeed { get; set;}
}
Loading

0 comments on commit 8e43826

Please sign in to comment.