-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBenchmarkLaunchWindow.axaml
More file actions
158 lines (145 loc) · 10.2 KB
/
Copy pathBenchmarkLaunchWindow.axaml
File metadata and controls
158 lines (145 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<Window x:Class="LlamaServerLauncher.BenchmarkLaunchWindow"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="clr-namespace:LlamaServerLauncher.ViewModels;assembly=LlamaServerLauncher"
Title="{Binding Localized.BenchmarkRunSave}"
Width="660" Height="680"
WindowStartupLocation="CenterOwner"
CanResize="True"
MinWidth="480" MinHeight="520"
Background="{DynamicResource WindowBackgroundBrush}">
<Grid Margin="15" RowDefinitions="*,Auto,Auto">
<ScrollViewer Grid.Row="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<StackPanel Margin="0,0,6,0">
<TextBlock Text="{Binding Localized.BenchmarkArgsLabel}" FontWeight="Bold" Margin="0,0,0,5"/>
<ScrollViewer Height="120" VerticalScrollBarVisibility="Auto" Margin="0,0,0,8">
<TextBox Text="{Binding ArgsText}" AcceptsReturn="True" TextWrapping="Wrap"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
ToolTip.Tip="{Binding Localized.TooltipCustomArguments}"/>
</ScrollViewer>
<ItemsControl ItemsSource="{Binding ArgItems}" Margin="0,0,0,4">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ToggleButton IsChecked="{Binding IsEnabled}"
Margin="0,0,5,5" Padding="8,4"
Tapped="ArgToggleTapped"
RightTapped="ArgToggleRightTapped">
<TextBlock Text="{Binding Name}"/>
</ToggleButton>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
<TextBlock Text="{Binding Localized.CustomArgumentToggleHint}"
FontSize="11" Opacity="0.6" Margin="0,0,0,10"
IsVisible="{Binding HasArgItems}"/>
<StackPanel Orientation="Horizontal" Spacing="20" Margin="0,0,0,10">
<CheckBox Content="{Binding Localized.BenchmarkFixSeed}" IsChecked="{Binding FixSeed}"/>
<CheckBox Content="{Binding Localized.BenchmarkCollectMetrics}" IsChecked="{Binding EnableMetrics}"
IsEnabled="{Binding MetricsSupported}"/>
</StackPanel>
<Border Padding="10" Margin="0,0,0,10" CornerRadius="5"
Background="{DynamicResource PanelBackgroundBrush}">
<StackPanel>
<CheckBox Content="{Binding Localized.BenchmarkStandardRun}" IsChecked="{Binding RunStandardWorkload}"/>
<Grid ColumnDefinitions="Auto,Auto,Auto,*" Margin="0,8,0,0"
IsVisible="{Binding RunStandardWorkload}">
<StackPanel Grid.Column="0" Margin="0,0,15,0">
<TextBlock Text="{Binding Localized.BenchmarkPromptTokens}" Margin="0,0,0,3"/>
<NumericUpDown Value="{Binding StdPromptTokens}" Minimum="1" Maximum="131072" Width="120"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0,15,0">
<TextBlock Text="{Binding Localized.BenchmarkNPredict}" Margin="0,0,0,3"/>
<NumericUpDown Value="{Binding StdNPredict}" Minimum="1" Maximum="32768" Width="120"/>
</StackPanel>
<StackPanel Grid.Column="2" Margin="0,0,15,0">
<TextBlock Text="{Binding Localized.BenchmarkRepeat}" Margin="0,0,0,3"/>
<NumericUpDown Value="{Binding StdRepeat}" Minimum="1" Maximum="50" Width="120"/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
<Border Padding="10" Margin="0,0,0,10" CornerRadius="5"
Background="{DynamicResource PanelBackgroundBrush}">
<StackPanel>
<CheckBox Content="{Binding Localized.BenchmarkPromptRun}"
IsChecked="{Binding RunPromptWorkload}"
ToolTip.Tip="{Binding Localized.TooltipBenchmarkPromptRun}"/>
<StackPanel Margin="0,8,0,0" IsVisible="{Binding RunPromptWorkload}">
<TextBlock Text="{Binding Localized.BenchmarkPromptSystem}" Margin="0,0,0,3"/>
<TextBox Text="{Binding PromptSystem, UpdateSourceTrigger=PropertyChanged}"
AcceptsReturn="True" TextWrapping="Wrap" Height="56"
VerticalContentAlignment="Top"
ToolTip.Tip="{Binding Localized.TooltipBenchmarkPromptSystem}"/>
<TextBlock Text="{Binding Localized.BenchmarkPromptRequests}" Margin="0,8,0,3"/>
<TextBox Text="{Binding PromptsText, UpdateSourceTrigger=PropertyChanged}"
AcceptsReturn="True" TextWrapping="Wrap" Height="92"
VerticalContentAlignment="Top"
ToolTip.Tip="{Binding Localized.TooltipBenchmarkPromptRequests}"/>
<TextBlock Text="{Binding Localized.BenchmarkPromptSeparatorHint}"
FontSize="11" Opacity="0.6" TextWrapping="Wrap" Margin="0,3,0,0"/>
<Grid ColumnDefinitions="Auto,Auto,Auto,*" Margin="0,8,0,0">
<StackPanel Grid.Column="0" Margin="0,0,15,0">
<TextBlock Text="{Binding Localized.BenchmarkPromptMaxTokens}" Margin="0,0,0,3"/>
<NumericUpDown Value="{Binding PromptMaxTokens}" Minimum="0" Maximum="131072"
Increment="128" Width="120"
ToolTip.Tip="{Binding Localized.TooltipBenchmarkPromptMaxTokens}"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="0,0,15,0">
<TextBlock Text="{Binding Localized.BenchmarkPromptTimeout}" Margin="0,0,0,3"/>
<NumericUpDown Value="{Binding PromptTimeoutSeconds}" Minimum="5" Maximum="7200"
Increment="30" Width="120"/>
</StackPanel>
<CheckBox Grid.Column="2" Content="{Binding Localized.BenchmarkPromptKeepContext}"
IsChecked="{Binding PromptKeepContext}"
VerticalAlignment="Bottom" Margin="0,0,15,6"
ToolTip.Tip="{Binding Localized.TooltipBenchmarkPromptKeepContext}"/>
<TextBlock Grid.Column="3" Text="{Binding PromptCountText}"
VerticalAlignment="Bottom" HorizontalAlignment="Right"
Margin="0,0,0,8" Opacity="0.75"/>
</Grid>
</StackPanel>
</StackPanel>
</Border>
<CheckBox Content="{Binding Localized.BenchmarkStopAfterRun}"
IsChecked="{Binding StopAfterWorkload}"
IsVisible="{Binding HasWorkload}" Margin="0,0,0,10"/>
<Grid ColumnDefinitions="*,*" Margin="0,0,0,10">
<StackPanel Grid.Column="0" Margin="0,0,8,0">
<TextBlock Text="{Binding Localized.BenchmarkLabel}" Margin="0,0,0,3"/>
<TextBox Text="{Binding Label, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
<StackPanel Grid.Column="1" Margin="8,0,0,0">
<TextBlock Text="{Binding Localized.BenchmarkNotes}" Margin="0,0,0,3"/>
<TextBox Text="{Binding Notes, UpdateSourceTrigger=PropertyChanged}"/>
</StackPanel>
</Grid>
</StackPanel>
</ScrollViewer>
<Grid Grid.Row="1" RowDefinitions="Auto,Auto" Margin="0,0,0,10">
<TextBlock Text="{Binding Localized.BenchmarkCommandPreview}" FontWeight="Bold" Margin="0,0,0,5"/>
<Border Grid.Row="1" Background="{DynamicResource CommandBackgroundBrush}" CornerRadius="4" Padding="10,8"
MinHeight="60" MaxHeight="140">
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
<SelectableTextBlock Text="{Binding CommandPreview}"
FontFamily="Cascadia Code,Consolas,Menlo,Monospace"
Foreground="{DynamicResource CommandForegroundBrush}"
TextWrapping="Wrap"/>
</ScrollViewer>
</Border>
</Grid>
<Grid Grid.Row="2" ColumnDefinitions="Auto,*,Auto">
<Button Grid.Column="0" Content="{Binding Localized.HelpButton}" Click="HelpClick" Padding="15,6"
ToolTip.Tip="{Binding Localized.HelpDialogTooltip}"/>
<StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10">
<Button Content="{Binding Localized.BenchmarkRunButton}" Click="RunClick" Padding="15,6"
IsEnabled="{Binding CanRun}"/>
<Button Content="{Binding Localized.Cancel}" Click="CancelClick" Padding="15,6"/>
</StackPanel>
</Grid>
</Grid>
</Window>