From fa2a7d5b637f8243ef543017defcd46fbf3a9d42 Mon Sep 17 00:00:00 2001 From: MeloAlright Date: Fri, 8 Nov 2024 01:20:44 +0800 Subject: [PATCH] 0 6 5 (#52) * feat: remove sophon as default in 0_6_5 * feat: comment sophon doc in README * feat: comment sophon workflow --- .github/workflows/Sophon.yml | 62 +++++++++++++-------------- Cargo.lock | 4 +- Cargo.toml | 4 +- README.md | 83 ++++++++++++++++++++++++------------ interpreter/Cargo.toml | 2 +- 5 files changed, 91 insertions(+), 64 deletions(-) diff --git a/.github/workflows/Sophon.yml b/.github/workflows/Sophon.yml index 8981628..c24dc5f 100644 --- a/.github/workflows/Sophon.yml +++ b/.github/workflows/Sophon.yml @@ -1,31 +1,31 @@ -name: sophon reasoning - -on: - push: - branches: - - '*' - pull_request: - branches: - - main - -jobs: - reasoning: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - components: clippy - override: true - - - name: Repl - run: | - cargo build --features="repl" --release - - - name: LLama - run: | - ./target/release/3body -V - git clone https://huggingface.co/huantian2415/vicuna-13b-chinese-4bit-ggml - ./target/release/3body -c 'let 智子 = fn () { let instance = 智子工程({ "type": "llama", "path": "./vicuna-13b-chinese-4bit-ggml/Vicuna-13B-chinese.bin", "prompt": "你是三体文明的智子" }); return { "回答": fn (问题) { instance.infer(instance, 问题) } } }(); 智子.回答("中国最佳科幻小说是哪个")' +#name: sophon reasoning +# +#on: +# push: +# branches: +## - '*' +# pull_request: +# branches: +## - main +# +#jobs: +# reasoning: +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v4 +# - uses: actions-rs/toolchain@v1 +# with: +# toolchain: stable +# components: clippy +# override: true +# +# - name: Repl +# run: | +# cargo build --features="repl" --release +# +# - name: LLama +# run: | +# ./target/release/3body -V +# git clone https://huggingface.co/huantian2415/vicuna-13b-chinese-4bit-ggml +# ./target/release/3body -c 'let 智子 = fn () { let instance = 智子工程({ "type": "llama", "path": "./vicuna-13b-chinese-4bit-ggml/Vicuna-13B-chinese.bin", "prompt": "你是三体文明的智子" }); return { "回答": fn (问题) { instance.infer(instance, 问题) } } }(); 智子.回答("中国最佳科幻小说是哪个")' diff --git a/Cargo.lock b/Cargo.lock index 558717a..790c963 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -776,7 +776,7 @@ dependencies = [ [[package]] name = "three_body_interpreter" -version = "0.6.4" +version = "0.6.5" dependencies = [ "llm", "llm-base", @@ -788,7 +788,7 @@ dependencies = [ [[package]] name = "three_body_lang" -version = "0.6.4" +version = "0.6.5" dependencies = [ "rustyline", "rustyline-derive", diff --git a/Cargo.toml b/Cargo.toml index e9fa2df..d24fe37 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "three_body_lang" description = "Three Body Language written in Rust" edition = "2021" -version = "0.6.4" +version = "0.6.5" authors = ["meloalright", "rustq"] license = "MIT" @@ -12,7 +12,7 @@ members = ["interpreter"] [dependencies] rustyline = { version = "12.0.0", optional = true } rustyline-derive = { version = "0.4.0", optional = true } -three_body_interpreter = { version = "0.6.4", path = "./interpreter", features = ["sophon", "threading"] } +three_body_interpreter = { version = "0.6.5", path = "./interpreter", features = ["threading"] } [[bin]] name = "3body" diff --git a/README.md b/README.md index 5bb9f63..760524f 100644 --- a/README.md +++ b/README.md @@ -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": , "path": , "prompt": }) -``` +[//]: # () +[//]: # (```shell) -|property|type|Explanation| -|---|---|---| -|type|string|模型类型| -|path|string|模型所在路径| -|prompt|string|提示词| +[//]: # (智子工程({ "type": , "path": , "prompt": })) -#### 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||模型| -|character|string|提示词角色| -|infer|BuiltinFunc|执行推理| -|close|BuiltinFunc|关闭会话| +[//]: # (|path|string|模型所在路径|) + +[//]: # (|prompt|string|提示词|) + +[//]: # (#### Reasoning) + +[//]: # () +[//]: # (```rust) + +[//]: # (let 智子 = fn () { let instance = 智子工程({ "type": "llama", "path": "./Vicuna-13B-chinese.bin", "prompt": "你是三体文明的智子" }); return { "回答": fn (问题) { instance.infer(instance, 问题) } } }();) + +[//]: # () +[//]: # (智子.回答("中国最佳科幻小说是哪个")) + +[//]: # () +[//]: # (// > 推理中...) + +[//]: # (```) + +[//]: # () +[//]: # (|property|type|Explanation|) + +[//]: # (|---|---|---|) + +[//]: # (|model||模型|) + +[//]: # (|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](https://github.com/rustq/3body-lang/actions/workflows/Sophon.yml/badge.svg)](https://github.com/rustq/3body-lang/actions/)) -⚛️ 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](https://github.com/rustq/3body-lang/actions/runs/11092893924/job/30818494323?pr=47#step:5:2676)) -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](https://huggingface.co/huantian2415/vicuna-13b-chinese-4bit-ggml)) ## Development diff --git a/interpreter/Cargo.toml b/interpreter/Cargo.toml index b58a5ce..333c999 100644 --- a/interpreter/Cargo.toml +++ b/interpreter/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "three_body_interpreter" description = "Three Body interpreter" -version = "0.6.4" +version = "0.6.5" edition = "2021" authors = ["meloalright", "rustq"] license = "MIT"