Skip to content

Commit

Permalink
embedded a version of models.json; fix doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
Judd committed Nov 29, 2024
1 parent ab55511 commit 724e98b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions bindings/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ import strutils, std/strformat, std/httpclient, os, json, asyncdispatch
import libchatllm
import packages/docutils/highlite, terminal

import std/terminal
import std/[os, strutils]

var all_models: JsonNode = nil

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

if not all_models.contains(parts[0]): return nil
let model = all_models[parts[0]]
Expand Down
2 changes: 1 addition & 1 deletion docs/quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
For Windows users, the easies way is to download a release, extract it, and start chatting:

```
main -i -m :qwen2.5:0.5b
main -i -m :qwen2:0.5b
Downloading qwen2:0.5b
|████████████████████████████████████████████████████████████| 100.0%
________ __ __ __ __ ___ (通义千问)
Expand Down

0 comments on commit 724e98b

Please sign in to comment.