Skip to content

Commit 3e53ed4

Browse files
committed
fix: build error after dropping LLamaModelV1.
1 parent 56c56b9 commit 3e53ed4

File tree

2 files changed

+45
-4
lines changed

2 files changed

+45
-4
lines changed

LLama/LLamaSharp.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<Platforms>AnyCPU;x64</Platforms>
99
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
1010

11-
<Version>0.2.4</Version>
11+
<Version>0.3.0</Version>
1212
<Authors>Yaohui Liu, Haiping Chen</Authors>
1313
<Company>SciSharp STACK</Company>
1414
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -18,10 +18,10 @@
1818
<PackageIconUrl>https://avatars3.githubusercontent.com/u/44989469?s=200&amp;v=4</PackageIconUrl>
1919
<PackageTags>LLama, LLM, GPT, ChatGPT, NLP, AI, Chat Bot, SciSharp</PackageTags>
2020
<Description>
21-
The .NET binding of LLama.cpp, providing APIs to run the model and deploy it on Web.
21+
The .NET binding of LLama.cpp, providing APIs to run the model and deploy it on Web. For model weights to run, please go to https://github.com/SciSharp/LLamaSharp for more information.
2222
</Description>
2323
<PackageReleaseNotes>
24-
LLama 0.2.4 mainly supports loading and saving session state.
24+
LLamaSharp 0.3.0 supports loading and saving session state, tokenization and detokenization. Besides, since 0.3.0, `LLamaModelV1` is dropped.
2525
</PackageReleaseNotes>
2626
<PackageLicenseExpression>MIT</PackageLicenseExpression>
2727
<PackageOutputPath>packages</PackageOutputPath>
@@ -35,7 +35,7 @@
3535
</PropertyGroup>
3636

3737
<ItemGroup>
38-
<None Include="..\README.md" Pack="true" PackagePath="\"/>
38+
<None Include="..\README.md" Pack="true" PackagePath="\" />
3939
</ItemGroup>
4040

4141
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">

LLama/LLamaTypes.cs

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace LLama.Types
6+
{
7+
public enum ChatRole
8+
{
9+
Human,
10+
Assistant
11+
}
12+
public record EmbeddingUsage(int PromptTokens, int TotalTokens);
13+
14+
public record EmbeddingData(int Index, string Object, float[] Embedding);
15+
16+
public record Embedding(string Object, string Model, EmbeddingData[] Data, EmbeddingUsage Usage);
17+
18+
public record CompletionLogprobs(int[] TextOffset, float[] TokenLogProbs, string[] Tokens, Dictionary<string, float>[] TopLogprobs);
19+
20+
public record CompletionChoice(string Text, int Index, CompletionLogprobs? Logprobs, string? FinishReason);
21+
22+
public record CompletionUsage(int PromptTokens, int CompletionTokens, int TotalTokens);
23+
24+
public record CompletionChunk(string Id, string Object, int Created, string Model, CompletionChoice[] Choices);
25+
26+
public record Completion(string Id, string Object, int Created, string Model, CompletionChoice[] Choices, CompletionUsage Usage);
27+
28+
public record ChatCompletionMessage(ChatRole Role, string Content, string? Name = null);
29+
30+
public record ChatCompletionChoice(int Index, ChatCompletionMessage Message, string? FinishReason);
31+
32+
public record ChatCompletion(string Id, string Object, int Created, string Model, ChatCompletionChoice[] Choices, CompletionUsage Usage);
33+
34+
public record ChatCompletionChunkDelta(string? Role, string? Content);
35+
36+
public record ChatCompletionChunkChoice(int Index, ChatCompletionChunkDelta Delta, string? FinishReason);
37+
38+
public record ChatCompletionChunk(string Id, string Model, string Object, int Created, ChatCompletionChunkChoice[] Choices);
39+
40+
public record ChatMessageRecord(ChatCompletionMessage Message, DateTime Time);
41+
}

0 commit comments

Comments
 (0)