Skip to content

Commit

Permalink
feat: comment sophon doc in README
Browse files Browse the repository at this point in the history
  • Loading branch information
meloalright committed Nov 7, 2024
1 parent dd75c35 commit 4a71ea0
Showing 1 changed file with 55 additions and 28 deletions.
83 changes: 55 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,48 +242,75 @@ cx.join(秘密研究)
⚛️ Example threading of "星环公司" in [runs/11302243115](https://github.com/rustq/3body-lang/actions/runs/11302243115/job/31437809217)
## 🤗 LLM
[//]: # ()
[//]: # (## 🤗 LLM)
三体编程语言可以通过 "智子工程" 加载本地大语言模型进行推理。
[//]: # ()
[//]: # (三体编程语言可以通过 "智子工程" 加载本地大语言模型进行推理。)
Able to use three body language sophon to load a local large language model for reasoning, inspired by [wiki/sophon](https://three-body-problem.fandom.com/wiki/Sophon) and powered by [rustformers/llm](https://github.com/rustformers/llm).
[//]: # ()
[//]: # (Able to use three body language sophon to load a local large language model for reasoning, inspired by [wiki/sophon](https://three-body-problem.fandom.com/wiki/Sophon) and powered by [rustformers/llm](https://github.com/rustformers/llm).)
![sophon](https://github.com/rustq/3body-lang/assets/11075892/4579ecbe-3e52-4b0f-8f0b-31e3b071a79b)
[//]: # ()
[//]: # (![sophon](https://github.com/rustq/3body-lang/assets/11075892/4579ecbe-3e52-4b0f-8f0b-31e3b071a79b))
#### Sophon Initializing
[//]: # ()
[//]: # (#### Sophon Initializing)
```shell
智子工程({ "type": <string>, "path": <string>, "prompt": <string> })
```
[//]: # ()
[//]: # (```shell)

|property|type|Explanation|
|---|---|---|
|type|string|模型类型|
|path|string|模型所在路径|
|prompt|string|提示词|
[//]: # (智子工程&#40;{ "type": <string>, "path": <string>, "prompt": <string> }&#41;)

#### Reasoning
[//]: # (```)

```rust
let 智子 = fn () { let instance = 智子工程({ "type": "llama", "path": "./Vicuna-13B-chinese.bin", "prompt": "你是三体文明的智子" }); return { "回答": fn (问题) { instance.infer(instance, 问题) } } }();
[//]: # ()
[//]: # (|property|type|Explanation|)

智子.回答("中国最佳科幻小说是哪个")
[//]: # (|---|---|---|)

// > 推理中...
```
[//]: # (|type|string|模型类型|)

|property|type|Explanation|
|---|---|---|
|model|<NativeObject::LLMModel>|模型|
|character|string|提示词角色|
|infer|BuiltinFunc|执行推理|
|close|BuiltinFunc|关闭会话|
[//]: # (|path|string|模型所在路径|)

[//]: # (|prompt|string|提示词|)

[//]: # (#### Reasoning)

[//]: # ()
[//]: # (```rust)

[//]: # (let 智子 = fn &#40;&#41; { let instance = 智子工程&#40;{ "type": "llama", "path": "./Vicuna-13B-chinese.bin", "prompt": "你是三体文明的智子" }&#41;; return { "回答": fn &#40;问题&#41; { instance.infer&#40;instance, 问题&#41; } } }&#40;&#41;;)

[//]: # ()
[//]: # (智子.回答&#40;"中国最佳科幻小说是哪个"&#41;)

[//]: # ()
[//]: # (// > 推理中...)

[//]: # (```)

[//]: # ()
[//]: # (|property|type|Explanation|)

[//]: # (|---|---|---|)

[//]: # (|model|<NativeObject::LLMModel>|模型|)

[//]: # (|character|string|提示词角色|)

[//]: # (|infer|BuiltinFunc|执行推理|)

[//]: # (|close|BuiltinFunc|关闭会话|)

[![sophon workflow](https://github.com/rustq/3body-lang/actions/workflows/Sophon.yml/badge.svg)](https://github.com/rustq/3body-lang/actions/)
[//]: # ()
[//]: # ([![sophon workflow]&#40;https://github.com/rustq/3body-lang/actions/workflows/Sophon.yml/badge.svg&#41;]&#40;https://github.com/rustq/3body-lang/actions/&#41;)

⚛️ Example reasoning of "中国最佳科幻小说是哪个" in [runs/11092893924](https://github.com/rustq/3body-lang/actions/runs/11092893924/job/30818494323?pr=47#step:5:2676)
[//]: # ()
[//]: # (⚛️ Example reasoning of "中国最佳科幻小说是哪个" in [runs/11092893924]&#40;https://github.com/rustq/3body-lang/actions/runs/11092893924/job/30818494323?pr=47#step:5:2676&#41;)

Model powered by [huantian2415/vicuna-13b-chinese-4bit-ggml](https://huggingface.co/huantian2415/vicuna-13b-chinese-4bit-ggml)
[//]: # ()
[//]: # (Model powered by [huantian2415/vicuna-13b-chinese-4bit-ggml]&#40;https://huggingface.co/huantian2415/vicuna-13b-chinese-4bit-ggml&#41;)

## Development

Expand Down

0 comments on commit 4a71ea0

Please sign in to comment.