Skip to content

Commit 071d741

Browse files
committed
Tidy nuget pipeline, Upscale docs
1 parent 7a3fbcf commit 071d741

File tree

13 files changed

+204
-85
lines changed

13 files changed

+204
-85
lines changed

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<Project>
22
<PropertyGroup>
3-
<Version>0.1.1</Version>
3+
<Version>0.1.7</Version>
44
<Company>TensorStack</Company>
5-
<Copyright>TensorStack 2025</Copyright>
5+
<Copyright>TensorStack - 2025</Copyright>
66
<RepositoryUrl>https://github.com/TensorStack-AI/TensorStack</RepositoryUrl>
77
<PackageTags>onnx;onnx-runtime;</PackageTags>
88
<Authors>sa_ddam213</Authors>

TensorStack.Audio.Windows/TensorStack.Audio.Windows.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0-windows</TargetFramework>
4+
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
55
<PlatformTarget>x64</PlatformTarget>
66
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
77
</PropertyGroup>
@@ -38,6 +38,16 @@
3838
<Pack>True</Pack>
3939
<PackagePath>\</PackagePath>
4040
</None>
41+
<Content Include="ffmpeg.exe">
42+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
43+
<PackageCopyToOutput>true</PackageCopyToOutput>
44+
<Pack>true</Pack>
45+
</Content>
46+
<Content Include="ffprobe.exe">
47+
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
48+
<PackageCopyToOutput>true</PackageCopyToOutput>
49+
<Pack>true</Pack>
50+
</Content>
4151
</ItemGroup>
4252

4353
</Project>
82.5 MB
Binary file not shown.
82.3 MB
Binary file not shown.

TensorStack.Common/Common/FileHelper.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public static string RandomFileName(string extension)
4040

4141
public static string RandomFileName(string directory, string extension)
4242
{
43+
Directory.CreateDirectory(directory);
4344
return Path.Combine(directory, RandomFileName(extension));
4445
}
4546
}

TensorStack.Common/ModelConfig.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ namespace TensorStack.Common
66
{
77
public record ModelConfig
88
{
9+
private ExecutionProvider _executionProvider;
10+
911
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1012
public string Path { get; set; }
1113

1214
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
1315
public bool IsOptimizationSupported { get; set; }
1416

1517
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
16-
public ExecutionProvider ExecutionProvider { get; private set; }
18+
public ExecutionProvider ExecutionProvider
19+
{
20+
get { return _executionProvider; }
21+
init { _executionProvider = value; }
22+
}
1723

1824
public virtual void SetProvider(ExecutionProvider executionProvider)
1925
{
20-
ExecutionProvider = executionProvider;
26+
_executionProvider = executionProvider;
2127
}
2228
}
2329
}

TensorStack.Image.Bitmap/TensorStack.Image.Bitmap.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0-windows</TargetFramework>
4+
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
55
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
66
<PlatformTarget>x64</PlatformTarget>
77
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

TensorStack.Image.BitmapImage/TensorStack.Image.BitmapImage.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net9.0-windows</TargetFramework>
4+
<TargetFramework>net9.0-windows10.0.17763.0</TargetFramework>
55
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
66
<PlatformTarget>x64</PlatformTarget>
77
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

TensorStack.TextGeneration/Pipelines/Phi/Phi3Pipeline.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ protected override async Task<Sequence> InitializeAsync(GenerateOptions options)
123123
var inputIds = TokenizerOutput.InputIds;
124124
var positionIds = GetPositionIds(modelMetadata, 0, position);
125125
var attentionMask = new Tensor<long>([1, position], 1);
126-
RunDecoderInternalAsync(modelMetadata, sequence, inputIds, positionIds, attentionMask, false);
126+
RunDecoderInternal(modelMetadata, sequence, inputIds, positionIds, attentionMask, false);
127127
return sequence;
128128
}
129129

@@ -140,7 +140,7 @@ protected override async Task<Tensor<float>> RunDecoderAsync(Sequence sequence)
140140
var inputIds = new Tensor<long>([1, 1], sequence.Tokens[^1]);
141141
var positionIds = GetPositionIds(modelMetadata, position);
142142
var attentionMask = new Tensor<long>([1, position], 1);
143-
return RunDecoderInternalAsync(modelMetadata, sequence, inputIds, positionIds, attentionMask, true);
143+
return RunDecoderInternal(modelMetadata, sequence, inputIds, positionIds, attentionMask, true);
144144
}
145145

146146

@@ -153,7 +153,7 @@ protected override async Task<Tensor<float>> RunDecoderAsync(Sequence sequence)
153153
/// <param name="positionIds">The position ids.</param>
154154
/// <param name="attentionMask">The attention mask.</param>
155155
/// <param name="useBranchCache">if set to <c>true</c> [use branch cache].</param>
156-
private Tensor<float> RunDecoderInternalAsync(ModelMetadata modelMetadata, Sequence sequence, Tensor<long> inputIds, Tensor<long> positionIds, Tensor<long> attentionMask, bool useBranchCache)
156+
private Tensor<float> RunDecoderInternal(ModelMetadata modelMetadata, Sequence sequence, Tensor<long> inputIds, Tensor<long> positionIds, Tensor<long> attentionMask, bool useBranchCache)
157157
{
158158
using (var parameters = new ModelParameters(modelMetadata))
159159
{

TensorStack.TextGeneration/Tokenizers/BPETokenizer.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ public string Decode(int token, bool considerSpecialTokens = false)
116116
/// <param name="token">The token.</param>
117117
public string Decode(long token, bool considerSpecialTokens = false)
118118
{
119-
return VocabularyMap[token];
119+
if (!considerSpecialTokens && SpecialTokensMap.ContainsKey(token))
120+
return string.Empty;
121+
122+
return TokensToString([VocabularyMap[token]]);
120123
}
121124

122125

0 commit comments

Comments
 (0)