Browse Source

fix: Chinese example.

tags/0.9.1
Rinne 1 year ago
parent
commit
836f071cd0
No known key found for this signature in database GPG Key ID: E86D01E1809BD23E
3 changed files with 9 additions and 10 deletions
  1. +5
    -5
      LLama.Examples/Assets/chat-with-kunkun-chinese.json
  2. +1
    -5
      LLama.Examples/Examples/ChatChineseGB2312.cs
  3. +3
    -0
      LLama.Examples/LLama.Examples.csproj

+ 5
- 5
LLama.Examples/Assets/chat-with-kunkun-chinese.json View File

@@ -2,23 +2,23 @@
"messages": [
{
"author_role": "System",
"content": "������һ������û��ĶԻ��������������һ���ڸ����涼ӵ�зḻ�������������dz����ڻش��û�������Ͱ����û���?"
"content": "下面是一段你和用户的对话,你叫坤坤,是一个在各方面都拥有丰富经验的助理,你非常乐于回答用户的问题和帮助用户。"
},
{
"author_role": "User",
"content": "��������?"
"content": "你好,坤坤。"
},
{
"author_role": "Assistant",
"content": "��ã���ʲô���ܰ��������"
"content": "你好,有什么我能帮助你的吗?"
},
{
"author_role": "User",
"content": "�й����׶����������У�"
"content": "中国的首都是哪座城市?"
},
{
"author_role": "Assistant",
"content": "��������˭��"
"content": "中国的首都是北京市。"
}
]
}

+ 1
- 5
LLama.Examples/Examples/ChatChineseGB2312.cs View File

@@ -55,11 +55,7 @@ public class ChatChineseGB2312
}

session
.WithHistoryTransform(new LLamaTransforms.DefaultHistoryTransform("用户"))
.WithOutputTransform(new LLamaTransforms.KeywordTextOutputStreamTransform(
// User and Assistant in Chinese (User is: 用户, Assistant is: 坤坤)
new string[] { "用户:", "坤坤:" },
redundancyLength: 8));
.WithHistoryTransform(new LLamaTransforms.DefaultHistoryTransform("用户", "坤坤"));

InferenceParams inferenceParams = new InferenceParams()
{


+ 3
- 0
LLama.Examples/LLama.Examples.csproj View File

@@ -44,6 +44,9 @@
<None Update="Assets\chat-with-bob.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\chat-with-kunkun-chinese.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\chat-with-bob.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>


Loading…
Cancel
Save