Skip to content

Commit 454d0f5

Browse files
committed
Rename views
1 parent f650d38 commit 454d0f5

File tree

9 files changed

+96
-20
lines changed

9 files changed

+96
-20
lines changed

Examples/TensorStack.Example.TextGeneration/MainWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
</Grid>
2424

2525
<!--Views-->
26-
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.TextToText}" Content="TextToText" />
27-
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.AudioToText}" Content="AudioToText" />
28-
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.TextToAudio}" Content="TextToAudio" />
26+
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.Summary}" Content="Summary" />
27+
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.Whisper}" Content="Whisper" />
28+
<Button Command="{Binding NavigateCommand}" CommandParameter="{x:Static Views:View.Supertonic}" Content="Supertonic" />
2929

3030
<!--Window Options-->
3131
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

Examples/TensorStack.Example.TextGeneration/MainWindow.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public MainWindow(Settings configuration, NavigationService navigation)
1717
NavigateCommand = new AsyncRelayCommand<View>(NavigateAsync, CanNavigate);
1818
InitializeComponent();
1919

20-
NavigateCommand.Execute(View.AudioToText);
20+
NavigateCommand.Execute(View.Whisper);
2121
}
2222

2323
public NavigationService Navigation { get; }

Examples/TensorStack.Example.TextGeneration/Settings.json

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,25 @@
2424
],
2525
"AudioToTextModels":[ {
2626
"Id": 1,
27+
"Name": "Whisper-Tiny",
28+
"IsDefault": true,
29+
"Type": "Whisper",
30+
"Version": "Tiny",
31+
"MinLength": 20,
32+
"MaxLength": 512,
33+
"Prefixes": [ "Transcribe", "Translate" ],
34+
"Path": "Models\\TextGeneration\\Whisper-Tiny",
35+
"UrlPaths": [
36+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/decoder_model_merged.onnx?download=true",
37+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/encoder_model.onnx?download=true",
38+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/merges.txt?download=true",
39+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/tokenizer_config.json?download=true",
40+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/vocab.json?download=true",
41+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/mel_filters.npz?download=true"
42+
]
43+
},
44+
{
45+
"Id": 2,
2746
"Name": "Whisper-Small",
2847
"IsDefault": true,
2948
"Type": "Whisper",
@@ -40,6 +59,63 @@
4059
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/vocab.json?download=true",
4160
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/mel_filters.npz?download=true"
4261
]
62+
},
63+
{
64+
"Id": 3,
65+
"Name": "Whisper-Medium",
66+
"IsDefault": true,
67+
"Type": "Whisper",
68+
"Version": "Medium",
69+
"MinLength": 20,
70+
"MaxLength": 512,
71+
"Prefixes": [ "Transcribe", "Translate" ],
72+
"Path": "Models\\TextGeneration\\Whisper-Medium",
73+
"UrlPaths": [
74+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/decoder_model_merged.onnx?download=true",
75+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/encoder_model.onnx?download=true",
76+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/merges.txt?download=true",
77+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/tokenizer_config.json?download=true",
78+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/vocab.json?download=true",
79+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/mel_filters.npz?download=true"
80+
]
81+
},
82+
{
83+
"Id": 4,
84+
"Name": "Whisper-Base",
85+
"IsDefault": true,
86+
"Type": "Whisper",
87+
"Version": "Base",
88+
"MinLength": 20,
89+
"MaxLength": 512,
90+
"Prefixes": [ "Transcribe", "Translate" ],
91+
"Path": "Models\\TextGeneration\\Whisper-Base",
92+
"UrlPaths": [
93+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/decoder_model_merged.onnx?download=true",
94+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/encoder_model.onnx?download=true",
95+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/merges.txt?download=true",
96+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/tokenizer_config.json?download=true",
97+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/vocab.json?download=true",
98+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/mel_filters.npz?download=true"
99+
]
100+
},
101+
{
102+
"Id": 5,
103+
"Name": "Whisper-Large",
104+
"IsDefault": true,
105+
"Type": "Whisper",
106+
"Version": "Large",
107+
"MinLength": 20,
108+
"MaxLength": 512,
109+
"Prefixes": [ "Transcribe", "Translate" ],
110+
"Path": "Models\\TextGeneration\\Whisper-Large",
111+
"UrlPaths": [
112+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/decoder_model_merged.onnx?download=true",
113+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/encoder_model.onnx?download=true",
114+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/merges.txt?download=true",
115+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/tokenizer_config.json?download=true",
116+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/vocab.json?download=true",
117+
"https://huggingface.co/TensorStack/TensorStack/resolve/main/TextGeneration/Whisper-Small/mel_filters.npz?download=true"
118+
]
43119
}
44120
]
45121
}

Examples/TensorStack.Example.TextGeneration/Views/TextToTextView.xaml renamed to Examples/TensorStack.Example.TextGeneration/Views/SummaryView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Views:ViewBase x:Class="TensorStack.Example.Views.TextToTextView"
1+
<Views:ViewBase x:Class="TensorStack.Example.Views.SummaryView"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -9,7 +9,7 @@
99
mc:Ignorable="d"
1010
d:DesignHeight="450"
1111
d:DesignWidth="800">
12-
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:TextToTextView}}}">
12+
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:SummaryView}}}">
1313

1414
<Grid.RowDefinitions>
1515
<RowDefinition Height="1*" />

Examples/TensorStack.Example.TextGeneration/Views/TextToTextView.xaml.cs renamed to Examples/TensorStack.Example.TextGeneration/Views/SummaryView.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
namespace TensorStack.Example.Views
1616
{
1717
/// <summary>
18-
/// Interaction logic for TextToTextView.xaml
18+
/// Interaction logic for SummaryView.xaml
1919
/// </summary>
20-
public partial class TextToTextView : ViewBase
20+
public partial class SummaryView : ViewBase
2121
{
2222
private Device _selectedDevice;
2323
private TextModel _selectedModel;
@@ -36,7 +36,7 @@ public partial class TextToTextView : ViewBase
3636
private bool _isMultipleResult;
3737
private int _selectedBeam;
3838

39-
public TextToTextView(Settings settings, NavigationService navigationService, ITextService textService)
39+
public SummaryView(Settings settings, NavigationService navigationService, ITextService textService)
4040
: base(settings, navigationService)
4141
{
4242
TextService = textService;
@@ -52,7 +52,7 @@ public TextToTextView(Settings settings, NavigationService navigationService, IT
5252
InitializeComponent();
5353
}
5454

55-
public override int Id => (int)View.TextToText;
55+
public override int Id => (int)View.Summary;
5656
public ITextService TextService { get; }
5757
public AsyncRelayCommand LoadCommand { get; }
5858
public AsyncRelayCommand UnloadCommand { get; }

Examples/TensorStack.Example.TextGeneration/Views/ViewBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public ViewBase(Settings settings, NavigationService navigationService)
1616

1717
public enum View
1818
{
19-
TextToText = 0,
20-
AudioToText = 1,
21-
TextToAudio = 2
19+
Summary = 0,
20+
Whisper = 1,
21+
Supertonic = 2
2222
}
2323
}

Examples/TensorStack.Example.TextGeneration/Views/AudioToTextView.xaml renamed to Examples/TensorStack.Example.TextGeneration/Views/WhisperView.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Views:ViewBase x:Class="TensorStack.Example.Views.AudioToTextView"
1+
<Views:ViewBase x:Class="TensorStack.Example.Views.WhisperView"
22
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
33
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
44
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -9,7 +9,7 @@
99
mc:Ignorable="d"
1010
d:DesignHeight="450"
1111
d:DesignWidth="800">
12-
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:AudioToTextView}}}">
12+
<Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:WhisperView}}}">
1313

1414
<Grid.RowDefinitions>
1515
<RowDefinition Height="1*" />

Examples/TensorStack.Example.TextGeneration/Views/AudioToTextView.xaml.cs renamed to Examples/TensorStack.Example.TextGeneration/Views/WhisperView.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
namespace TensorStack.Example.Views
1717
{
1818
/// <summary>
19-
/// Interaction logic for AudioToTextView.xaml
19+
/// Interaction logic for WhisperView.xaml
2020
/// </summary>
21-
public partial class AudioToTextView : ViewBase
21+
public partial class WhisperView : ViewBase
2222
{
2323
private Device _selectedDevice;
2424
private TextModel _selectedModel;
@@ -37,7 +37,7 @@ public partial class AudioToTextView : ViewBase
3737
private int _selectedBeam;
3838
private AudioInput _audioInput;
3939

40-
public AudioToTextView(Settings settings, NavigationService navigationService, ITextService textService)
40+
public WhisperView(Settings settings, NavigationService navigationService, ITextService textService)
4141
: base(settings, navigationService)
4242
{
4343
TextService = textService;
@@ -53,7 +53,7 @@ public AudioToTextView(Settings settings, NavigationService navigationService, I
5353
InitializeComponent();
5454
}
5555

56-
public override int Id => (int)View.AudioToText;
56+
public override int Id => (int)View.Whisper;
5757
public ITextService TextService { get; }
5858
public AsyncRelayCommand LoadCommand { get; }
5959
public AsyncRelayCommand UnloadCommand { get; }

TensorStack.WPF/Controls/AudioElement.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ private Task StopAsync()
266266

267267
private async Task<AudioInput> LoadAudioAsync(string initialFilename = null)
268268
{
269-
var sourceFilename = initialFilename ?? await DialogService.OpenFileAsync("Load Audio", "Audio", filter: "wav files (*.wav)|*.wav", defualtExt: "wav");
269+
var sourceFilename = initialFilename ?? await DialogService.OpenFileAsync("Load Audio", "Audio", filter: "Audio/Video files (*.mp3;*.wav;*.flac;*.m4a;*.aac;*.ogg;*.mp4;*.mov;*.mkv;*.webm)|*.mp3;*.wav;*.flac;*.m4a;*.aac;*.ogg;*.mp4;*.mov;*.mkv;*.webm", defualtExt: "wav");
270270
if (string.IsNullOrEmpty(sourceFilename))
271271
return default;
272272

0 commit comments

Comments
 (0)