Skip to content

Commit

Permalink
seal classes with IDisposable (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiidams authored Oct 10, 2023
1 parent 3af0bf4 commit 46c2edc
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -348,3 +348,6 @@ MigrationBackup/

# Ionide (cross platform F# VS Code tools) working folder
.ionide/

# ONNX runtime
*.onnx
2 changes: 1 addition & 1 deletion NeMoOnnxSharp.Example/ModelDownloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

namespace NeMoOnnxSharp.Example
{
internal class ModelDownloader : IDisposable
internal sealed class ModelDownloader : IDisposable
{
private readonly HttpClient _httpClient;

Expand Down
5 changes: 1 addition & 4 deletions NeMoOnnxSharp/EncDecCTCModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace NeMoOnnxSharp
{
public class EncDecCTCModel : ASRModel, IDisposable
public sealed class EncDecCTCModel : ASRModel, IDisposable
{
private const string Vocabulary = " abcdefghijklmnopqrstuvwxyz'_";

Expand Down
3 changes: 1 addition & 2 deletions NeMoOnnxSharp/EncDecClassificationModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NeMoOnnxSharp
{
public class EncDecClassificationModel : ASRModel, IDisposable
public sealed class EncDecClassificationModel : ASRModel, IDisposable
{
private static readonly string[] SpeechCommandsLabels = new string[]
{
Expand Down
2 changes: 1 addition & 1 deletion NeMoOnnxSharp/FrameVAD.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace NeMoOnnxSharp
{
public class FrameVAD : IDisposable
public sealed class FrameVAD : IDisposable
{
private readonly int _sampleRate;
private readonly int _modelWinLength;
Expand Down
3 changes: 1 addition & 2 deletions NeMoOnnxSharp/SpectrogramGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NeMoOnnxSharp
{
public class SpectrogramGenerator : IDisposable
public sealed class SpectrogramGenerator : IDisposable
{
private readonly BaseTokenizer _tokenizer;
private readonly InferenceSession _inferSess;
Expand Down
3 changes: 1 addition & 2 deletions NeMoOnnxSharp/SpeechRecognizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.InteropServices;

namespace NeMoOnnxSharp
{
public class SpeechRecognizer : IDisposable
public sealed class SpeechRecognizer : IDisposable
{
public delegate void SpeechStart(long position);
public delegate void SpeechEnd(long position, short[] audioSignal, string? transcript);
Expand Down
3 changes: 1 addition & 2 deletions NeMoOnnxSharp/Vocoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NeMoOnnxSharp
{
public class Vocoder : IDisposable
public sealed class Vocoder : IDisposable
{
private readonly InferenceSession _inferSess;
private readonly int _nfilt;
Expand Down

0 comments on commit 46c2edc

Please sign in to comment.