Skip to content

Commit d838e1c

Browse files
committed
implement IDisposable in LLamaRerankerTests and SafeLlamaModelHandleVocabularyTests
1 parent 63ae374 commit d838e1c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

LLama.Unittest/LLamaRerankerTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace LLama.Unittest;
99

10-
public sealed class LLamaRerankerTests
10+
public sealed class LLamaRerankerTests: IDisposable
1111
{
1212
private readonly ITestOutputHelper _testOutputHelper;
1313
private readonly LLamaReranker _reranker;
@@ -26,6 +26,11 @@ public LLamaRerankerTests(ITestOutputHelper testOutputHelper)
2626
_reranker = new LLamaReranker(weights, @params);
2727
}
2828

29+
public void Dispose()
30+
{
31+
_reranker.Dispose();
32+
}
33+
2934
[Fact]
3035
public async Task CompareRerankingScore()
3136
{

LLama.Unittest/Native/SafeLlamaModelHandleVocabularyTests.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
namespace LLama.Unittest.Native;
99

10-
public class SafeLlamaModelHandleVocabularyTests
10+
public class SafeLlamaModelHandleVocabularyTests: IDisposable
1111
{
1212
private readonly LLamaWeights _model;
1313

@@ -22,6 +22,11 @@ public SafeLlamaModelHandleVocabularyTests()
2222
_model = LLamaWeights.LoadFromFile(@params);
2323
}
2424

25+
public void Dispose()
26+
{
27+
_model.Dispose();
28+
}
29+
2530
[Fact]
2631
public void GetLLamaTokenString()
2732
{

0 commit comments

Comments
 (0)