Browse Source

fix: build error after dropping LLamaModelV1.

tags/v0.2.3
Yaohui Liu 3 years ago
parent
commit
3e53ed4753
No known key found for this signature in database GPG Key ID: E86D01E1809BD23E
2 changed files with 45 additions and 4 deletions
  1. +4
    -4
      LLama/LLamaSharp.csproj
  2. +41
    -0
      LLama/LLamaTypes.cs

+ 4
- 4
LLama/LLamaSharp.csproj View File

@@ -8,7 +8,7 @@
<Platforms>AnyCPU;x64</Platforms>
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

<Version>0.2.4</Version>
<Version>0.3.0</Version>
<Authors>Yaohui Liu, Haiping Chen</Authors>
<Company>SciSharp STACK</Company>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
@@ -18,10 +18,10 @@
<PackageIconUrl>https://avatars3.githubusercontent.com/u/44989469?s=200&amp;v=4</PackageIconUrl>
<PackageTags>LLama, LLM, GPT, ChatGPT, NLP, AI, Chat Bot, SciSharp</PackageTags>
<Description>
The .NET binding of LLama.cpp, providing APIs to run the model and deploy it on Web.
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.
</Description>
<PackageReleaseNotes>
LLama 0.2.4 mainly supports loading and saving session state.
LLamaSharp 0.3.0 supports loading and saving session state, tokenization and detokenization. Besides, since 0.3.0, `LLamaModelV1` is dropped.
</PackageReleaseNotes>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageOutputPath>packages</PackageOutputPath>
@@ -35,7 +35,7 @@
</PropertyGroup>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="\"/>
<None Include="..\README.md" Pack="true" PackagePath="\" />
</ItemGroup>

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


+ 41
- 0
LLama/LLamaTypes.cs View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace LLama.Types
{
public enum ChatRole
{
Human,
Assistant
}
public record EmbeddingUsage(int PromptTokens, int TotalTokens);

public record EmbeddingData(int Index, string Object, float[] Embedding);

public record Embedding(string Object, string Model, EmbeddingData[] Data, EmbeddingUsage Usage);

public record CompletionLogprobs(int[] TextOffset, float[] TokenLogProbs, string[] Tokens, Dictionary<string, float>[] TopLogprobs);

public record CompletionChoice(string Text, int Index, CompletionLogprobs? Logprobs, string? FinishReason);

public record CompletionUsage(int PromptTokens, int CompletionTokens, int TotalTokens);

public record CompletionChunk(string Id, string Object, int Created, string Model, CompletionChoice[] Choices);

public record Completion(string Id, string Object, int Created, string Model, CompletionChoice[] Choices, CompletionUsage Usage);

public record ChatCompletionMessage(ChatRole Role, string Content, string? Name = null);

public record ChatCompletionChoice(int Index, ChatCompletionMessage Message, string? FinishReason);

public record ChatCompletion(string Id, string Object, int Created, string Model, ChatCompletionChoice[] Choices, CompletionUsage Usage);

public record ChatCompletionChunkDelta(string? Role, string? Content);

public record ChatCompletionChunkChoice(int Index, ChatCompletionChunkDelta Delta, string? FinishReason);

public record ChatCompletionChunk(string Id, string Model, string Object, int Created, ChatCompletionChunkChoice[] Choices);

public record ChatMessageRecord(ChatCompletionMessage Message, DateTime Time);
}

Loading…
Cancel
Save