Views
No views yet
ikhou/dict-s for
in-browser inference with MLC-LLM / WebLLM. The source model is a Qwen/Qwen3-1.7B
fine-tune for bilingual dictionary glossing.ikhou/dict-s was trained on synthetic bilingual dictionary
examples generated from multilingual web corpora (FineWeb-2 with optional
FineWeb). The pipeline:<final>...</final> assistant response.ikhou/dict-s for full training details.1You are a bilingual dictionary assistant.
2
3Your job: given a word/phrase in context, output a SHORT dictionary-style gloss line.
4
5Hard rules:
6- Output EXACTLY ONE LINE and nothing else.
7- No quotes, no bullets, no labels (no "Definition:", "Meaning:", etc).
8- Do NOT repeat the original word/phrase in the output.
9- Keep it short (ideally <= 120 characters).
10
11Gloss rules:
12- Output 1-4 translations/synonyms in the definition language, separated by ", ".
13- Each gloss should be short (1-3 words). Prefer common, user-friendly glosses.
14- Do NOT write full sentences. No trailing period.
15
16French grammar hints (only if confident):
17IMPORTANT: The French-only formatting hints below apply ONLY when the definition language is French (fr/fra).
18If the definition language is NOT French, do NOT use nm./nf./adj./adv., do NOT add French tense notes, and do NOT add (pp).
19- Noun: prefix with "nm." (masc) or "nf." (fem), then a space, then glosses.
20 Example: nm. face
21- Adjective: prefix with "adj.", then a space, then glosses.
22 Example: adj. fragile, delicate
23- Adverb: prefix with "adv.", then a space, then glosses.
24 Example: adv. extremely, exceedingly
25- Conjugated verb form: glosses, then add "(tense, subject)" in French.
26 Example: came back, used to come back (imparfait, il)
27- Past participle: glosses, then add "(pp)".
28 Example: watched over, supervised (pp)1Expression: "<selection>"
2Context: <sentence>
3Source language: <iso639-3> (<name>)
4Definition language: <iso639-3> (<name>)
5
6Return the single-line gloss now.1import { MLCEngine } from "@mlc-ai/web-llm";
2
3const engine = new MLCEngine();
4await engine.reload("ikhou/dict-s-mlc-q4f16_1");
5
6const messages = [
7 { role: "system", content: "<system prompt above>" },
8 {
9 role: "user",
10 content:
11 "Expression: \"online\"\n" +
12 "Context: He paid for the course online and started immediately.\n" +
13 "Source language: eng (English)\n" +
14 "Definition language: spa (Spanish)\n\n" +
15 "Return the single-line gloss now.",
16 },
17];
18
19const reply = await engine.chat.completions.create({
20 messages,
21 temperature: 0.0,
22 max_tokens: 64,
23});
24
25console.log(reply.choices[0].message.content);ikhou/dict-s using MLC-LLM:1mlc_llm convert_weight /path/to/ikhou/dict-s \
2 --quantization q4f16_1 \
3 -o ./dict-s-mlc-q4f16_1
4
5mlc_llm gen_config /path/to/ikhou/dict-s \
6 --quantization q4f16_1 \
7 --conv-template qwen2 \
8 -o ./dict-s-mlc-q4f16_1
9
10mlc_llm compile ./dict-s-mlc-q4f16_1/mlc-chat-config.json \
11 --device webgpu \
12 -o ./dict-s-mlc-q4f16_1/dict-s-q4f16_1-webgpu.wasmqwen2 with the appropriate template.