Skip to content

Commit 724e98b

Browse files
author
Judd
committed
embedded a version of models.json; fix doc.
1 parent ab55511 commit 724e98b

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

bindings/main.nim

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@ import strutils, std/strformat, std/httpclient, os, json, asyncdispatch
22
import libchatllm
33
import packages/docutils/highlite, terminal
44

5-
import std/terminal
6-
import std/[os, strutils]
7-
85
var all_models: JsonNode = nil
96

107
proc get_model_url_on_modelscope(url: seq[string]): string =
@@ -18,8 +15,8 @@ proc parse_model_id(model_id: string): JsonNode =
1815
let parts = model_id.split(":")
1916
if all_models == nil:
2017
let fn = joinPath([parentDir(paramStr(0)), "../scripts/models.json"])
21-
if not fileExists(fn): return nil
22-
all_models = json.parseFile(fn)
18+
const compiled_file = readFile("../scripts/models.json")
19+
all_models = if fileExists(fn): json.parseFile(fn) else: json.parseJson(compiled_file)
2320

2421
if not all_models.contains(parts[0]): return nil
2522
let model = all_models[parts[0]]

docs/quick_start.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
For Windows users, the easies way is to download a release, extract it, and start chatting:
44

55
```
6-
main -i -m :qwen2.5:0.5b
6+
main -i -m :qwen2:0.5b
77
Downloading qwen2:0.5b
88
|████████████████████████████████████████████████████████████| 100.0%
99
________ __ __ __ __ ___ (通义千问)

0 commit comments

Comments
 (0)