Skip to content

A simple application using a large language model for translation.

License

Notifications You must be signed in to change notification settings

Ming-jiayou/AvaloniaChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

简体中文 | English

AvaloniaChat

A Simple Application Based on a Large Language Model for Translation✨

Introduction

A simple application of using a large language model for translation.

My main use case

While reading English literature, I prefer to compare translated versions. Although some software already has built-in translation functions, I still favor translations from large language models. However, I have to copy and paste the English text each time and manually add prompts, and the translated text doesn't align well for comparison.

Therefore, I have developed this software based on Avalonia and Semantic Kernel to address my own needs, and I'm open-sourcing it so that everyone can use it for free. I hope it will be of help to those with similar needs.

Quick Start

Note the 'Releases' section here:

image-20240816093724343

Clicking on the 'AvaloniaChat-v0.0.1-win-x64.zip' will result in the download:

image-20240816093952249

After decompressing, open the folder and it looks like this:

image-20240816094206770

Now, all you need to do is make a simple edit to the appsettings.json file, which is used to configure the large language model you're using.

Taking SiliconCloud as an example, it is most recommended to use SiliconCloud. Both Qwen/Qwen2-7B-Instruct are reportedly free and have fast inference speeds.

After registering on SiliconCloud, create an Api Key and copy this Api Key:

image-20240816094640258

Open the appsettings.json file, if using SiliconCloud, you only need to fill in the API Key:

image-20240816094800525

Now that the configuration is complete, you can use it by clicking the exe file:

image-20240816094827621

Question for AI:

image-20240816095611412

Translation from English to Chinese:

image-20240816100534403

Translation from Chinese to English:

image-20240816100742362

Building from Source Code Guide

Look here:Building from Source Code Guide

Configure other large language models

Xunfei Spark

Using Spark Max as an example,configure the appsettings.json file like this:

{
  "OpenAI": {
    "Key": "your key",
    "Endpoint": "https://spark-api-open.xf-yun.com",
    "ChatModel": "generalv3.5"
  }
}

View Xunfei Spark's API Key:

image-20240816101735673

The key format is like this: APIKey:APISecret, which should be written in the form: 6d3...:M...:

image-20240816102020096

Validate if it is configured successfully:

image-20240816102241575

LingYiWanWu

Take the example of yi-large:

{
  "OpenAI": {
    "Key": "your key",
    "Endpoint": "https://api.lingyiwanwu.com",
    "ChatModel": "yi-large"
  }
}

Validate if it is configured successfully:

image-20240816102914568

Update Record

2024.8.20:Compatible With ZhiPuAI

If you found the information helpful, a star✨ would be the most significant support for me. 😊

If you've gone through the guide and are still facing issues, feel free to reach out to me via my WeChat Official Account:

qrcode_for_gh_eb0908859e11_344

About

A simple application using a large language model for translation.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages