Skip to content

Commit e4e4449

Browse files
authored
Merge pull request #42879 from dotnet/main
Merge main into live
2 parents c2abc87 + e5c0e70 commit e4e4449

File tree

12 files changed

+34
-46
lines changed

12 files changed

+34
-46
lines changed

docs/azure/includes/dotnet-all.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@
537537
| Microsoft.Azure.Functions.Worker.ProjectTemplates | NuGet [4.0.5022](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.ProjectTemplates/4.0.5022) | | |
538538
| Microsoft.Azure.Functions.Worker.Sdk | NuGet [1.17.4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk/1.17.4)<br>NuGet [2.0.0-preview2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk/2.0.0-preview2) | | |
539539
| Microsoft.Azure.Functions.Worker.Sdk.Analyzers | NuGet [1.2.2](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk.Analyzers/1.2.2) | | |
540-
| Microsoft.Azure.Functions.Worker.Sdk.Generators | NuGet [1.3.3](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk.Generators/1.3.3) | | |
540+
| Microsoft.Azure.Functions.Worker.Sdk.Generators | NuGet [1.3.4](https://www.nuget.org/packages/Microsoft.Azure.Functions.Worker.Sdk.Generators/1.3.4) | | |
541541
| Microsoft.Azure.WebJobs.CosmosDb.ChangeProcessor | NuGet [1.0.4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.CosmosDb.ChangeProcessor/1.0.4) | | |
542542
| Microsoft.Azure.WebJobs.CosmosDb.Mongo | NuGet [1.0.4](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.CosmosDb.Mongo/1.0.4) | | |
543543
| Microsoft.Azure.WebJobs.Extensions.Kusto | NuGet [1.0.11-Preview](https://www.nuget.org/packages/Microsoft.Azure.WebJobs.Extensions.Kusto/1.0.11-Preview) | | |

docs/core/whats-new/dotnet-8/runtime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,11 @@ IDataView predictions = model.Transform(split.TestSet);
500500

501501
.NET 8 introduces several new types aimed at improving app performance.
502502

503-
- The new <xref:System.Collections.Frozen?displayProperty=fullName> namespace includes the collection types <xref:System.Collections.Frozen.FrozenDictionary%602> and <xref:System.Collections.Frozen.FrozenSet%601>. These types don't allow any changes to keys and values once a collection created. That requirement allows faster read operations (for example, `TryGetValue()`). These types are particularly useful for collections that are populated on first use and then persisted for the duration of a long-lived service, for example:
503+
- The new <xref:System.Collections.Frozen?displayProperty=fullName> namespace includes the collection types <xref:System.Collections.Frozen.FrozenDictionary%602> and <xref:System.Collections.Frozen.FrozenSet%601>. These types don't allow any changes to keys and values once a collection is created. That requirement allows faster read operations (for example, `TryGetValue()`). These types are particularly useful for collections that are populated on first use and then persisted for the duration of a long-lived service, for example:
504504

505505
```csharp
506506
private static readonly FrozenDictionary<string, bool> s_configurationData =
507-
LoadConfigurationData().ToFrozenDictionary(optimizeForReads: true);
507+
LoadConfigurationData().ToFrozenDictionary();
508508

509509
// ...
510510
if (s_configurationData.TryGetValue(key, out bool setting) && setting)

docs/core/whats-new/dotnet-9/libraries.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: What's new in .NET libraries for .NET 9
33
description: Learn about the new .NET libraries features introduced in .NET 9.
44
titleSuffix: ""
5-
ms.date: 09/09/2024
5+
ms.date: 10/08/2024
66
ms.topic: whats-new
77
---
88

99
# What's new in .NET libraries for .NET 9
1010

11-
This article describes new features in the .NET libraries for .NET 9. It's been updated for .NET 9 RC 1.
11+
This article describes new features in the .NET libraries for .NET 9. It's been updated for .NET 9 RC 2.
1212

1313
## Base64Url
1414

@@ -44,7 +44,7 @@ The following example demonstrates using [Dictionary<TKey,TValue>.GetAlternateLo
4444

4545
### `OrderedDictionary<TKey, TValue>`
4646

47-
In many scenarios, you might want to store key-value pairs in a way where order can be maintained (a list of key-value pairs) but where fast lookup by key is also supported (a dictionary of key-value pairs). Since the early days of .NET, the <xref:System.Collections.Specialized.OrderedDictionary> type has supported this scenario, but only in a non-generic manner, with keys and values typed as <xref:System.Collections.Generic.OrderedDictionary%602> collection, which provides an efficient, generic type to support these scenarios.
47+
In many scenarios, you might want to store key-value pairs in a way where order can be maintained (a list of key-value pairs) but where fast lookup by key is also supported (a dictionary of key-value pairs). Since the early days of .NET, the <xref:System.Collections.Specialized.OrderedDictionary> type has supported this scenario, but only in a non-generic manner, with keys and values typed as `object`. .NET 9 introduces the long-requested <xref:System.Collections.Generic.OrderedDictionary%602> collection, which provides an efficient, generic type to support these scenarios.
4848

4949
The following code uses the new class.
5050

docs/core/whats-new/dotnet-9/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: What's new in .NET 9
33
description: Learn about the new .NET features introduced in .NET 9 for the runtime, libraries, and SDK. Also find links to what's new in other areas, such as ASP.NET Core.
44
titleSuffix: ""
5-
ms.date: 09/10/2024
5+
ms.date: 10/08/2024
66
ms.topic: whats-new
77
---
88

docs/core/whats-new/dotnet-9/runtime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
title: What's new in .NET 9 runtime
33
description: Learn about the new .NET features introduced in the .NET 9 runtime.
44
titleSuffix: ""
5-
ms.date: 09/09/2024
5+
ms.date: 10/08/2024
66
ms.topic: whats-new
77
---
88
# What's new in the .NET 9 runtime
99

10-
This article describes new features and performance improvements in the .NET runtime for .NET 9. It's been updated for .NET 9 Preview 7.
10+
This article describes new features and performance improvements in the .NET runtime for .NET 9. It's been updated for .NET 9 RC 2.
1111

1212
## Attribute model for feature switches with trimming support
1313

docs/core/whats-new/dotnet-9/sdk.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
title: What's new in the SDK for .NET 9
33
description: Learn about the new .NET SDK features introduced in .NET 9, including for unit testing, terminal logger, tool roll-forward, and build script analyzers.
44
titleSuffix: ""
5-
ms.date: 09/09/2024
5+
ms.date: 10/08/2024
66
ms.topic: whats-new
77
---
88

99
# What's new in the SDK for .NET 9
1010

11-
This article describes new features in the .NET SDK for .NET 9. It's been updated for .NET RC 1.
11+
This article describes new features in the .NET SDK for .NET 9. It's been updated for .NET RC 2.
1212

1313
## Unit testing
1414

docs/csharp/language-reference/keywords/virtual.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ When a virtual method is invoked, the run-time type of the object is checked for
2828

2929
By default, methods are non-virtual. You cannot override a non-virtual method.
3030

31-
You cannot use the `virtual` modifier with the `static`, `abstract`, `private`, or `override` modifiers. The following example shows a virtual property:
31+
The following example shows a virtual property:
3232

3333
[!code-csharp[csrefKeywordsModifiers#26](~/samples/snippets/csharp/VS_Snippets_VBCSharp/csrefKeywordsModifiers/CS/csrefKeywordsModifiers.cs#26)]
3434

3535
Virtual properties behave like virtual methods, except for the differences in declaration and invocation syntax.
3636

37-
- It is an error to use the `virtual` modifier on a static property.
38-
3937
- A virtual inherited property can be overridden in a derived class by including a property declaration that uses the `override` modifier.
4038

4139
## Example

docs/csharp/linq/standard-query-operators/set-operations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The following example depicts the behavior of <xref:System.Linq.Enumerable.Inter
5858

5959
:::code language="csharp" source="./snippets/standard-query-operators/SetOperations.cs" id="Intersect":::
6060

61-
The <xref:System.Linq.Enumerable.IntersectBy%2A> method is an alternative approach to `Intersect` that takes two sequences of possibly heterogenous types and a `keySelector`. The `keySelector` is used as the comparative discriminator of the second collection's type. Consider the following student and teacher arrays. The query matches items in each sequence by name to find those students who aren't also teachers:
61+
The <xref:System.Linq.Enumerable.IntersectBy%2A> method is an alternative approach to `Intersect` that takes two sequences of possibly heterogenous types and a `keySelector`. The `keySelector` is used as the comparative discriminator of the second collection's type. Consider the following student and teacher arrays. The query matches items in each sequence by name to find those students who are also teachers:
6262

6363
:::code language="csharp" source="./snippets/standard-query-operators/SetOperations.cs" id="IntersectBy":::
6464

docs/machine-learning/whats-new/snippets/csharp/CodeGen.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public static void RunIt()
1212
using Stream vocabStream = File.OpenRead(phi2VocabPath);
1313
using Stream mergesStream = File.OpenRead(phi2MergePath);
1414

15-
Tokenizer phi2Tokenizer = Tokenizer.CreateCodeGen(vocabStream, mergesStream);
15+
Tokenizer phi2Tokenizer = CodeGenTokenizer.Create(vocabStream, mergesStream);
1616
IReadOnlyList<int> ids = phi2Tokenizer.EncodeToIds("Hello, World");
1717
// </CodeGen>
1818
}

docs/machine-learning/whats-new/snippets/csharp/Llama.cs

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
using Microsoft.ML.Tokenizers;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.IO;
5-
using System.Net.Http;
4+
using System.Linq;
5+
using Microsoft.ML.Tokenizers;
66

77
internal class Llama
88
{
@@ -12,7 +12,7 @@ public static void RunIt()
1212
// Create the Tokenizer.
1313
string modelUrl = @"https://huggingface.co/hf-internal-testing/llama-llamaTokenizer/resolve/main/llamaTokenizer.model";
1414
using Stream remoteStream = File.OpenRead(modelUrl);
15-
Tokenizer llamaTokenizer = Tokenizer.CreateLlama(remoteStream);
15+
Tokenizer llamaTokenizer = LlamaTokenizer.Create(remoteStream);
1616

1717
string text = "Hello, World!";
1818

@@ -32,27 +32,21 @@ public static void RunIt()
3232
// idsCount = 5
3333

3434
// Full encoding.
35-
EncodingResult result = llamaTokenizer.Encode(text);
36-
Console.WriteLine($"result.Tokens = {{'{string.Join("', '", result.Tokens)}'}}");
35+
IReadOnlyList<EncodedToken> result = llamaTokenizer.EncodeToTokens(text, out string? normalizedString);
36+
Console.WriteLine($"result.Tokens = {{'{string.Join("', '", result.Select(t => t.Value))}'}}");
3737
// result.Tokens = {'<s>', '▁Hello', ',', '▁World', '!'}
38-
Console.WriteLine($"result.Offsets = {{{string.Join(", ", result.Offsets)}}}");
39-
// result.Offsets = {(0, 0), (0, 6), (6, 1), (7, 6), (13, 1)}
40-
Console.WriteLine($"result.Ids = {{{string.Join(", ", result.Ids)}}}");
38+
Console.WriteLine($"result.Ids = {{{string.Join(", ", result.Select(t => t.Id))}}}");
4139
// result.Ids = {1, 15043, 29892, 2787, 29991}
4240

4341
// Encode up 2 tokens.
44-
int index1 = llamaTokenizer.IndexOfTokenCount(text, maxTokenCount: 2, out string processedText1, out int tokenCount1);
45-
Console.WriteLine($"processedText1 = {processedText1}");
46-
// processedText1 = ▁Hello,▁World!
42+
int index1 = llamaTokenizer.GetIndexByTokenCount(text, maxTokenCount: 2, out string? processedText1, out int tokenCount1);
4743
Console.WriteLine($"tokenCount1 = {tokenCount1}");
4844
// tokenCount1 = 2
4945
Console.WriteLine($"index1 = {index1}");
5046
// index1 = 6
5147

5248
// Encode from end up to one token.
53-
int index2 = llamaTokenizer.LastIndexOfTokenCount(text, maxTokenCount: 1, out string processedText2, out int tokenCount2);
54-
Console.WriteLine($"processedText2 = {processedText2}");
55-
// processedText2 = ▁Hello,▁World!
49+
int index2 = llamaTokenizer.GetIndexByTokenCountFromEnd(text, maxTokenCount: 1, out string? processedText2, out int tokenCount2);
5650
Console.WriteLine($"tokenCount2 = {tokenCount2}");
5751
// tokenCount2 = 1
5852
Console.WriteLine($"index2 = {index2}");

0 commit comments

Comments
 (0)