Instructions to use xpol555/sm-coder-mlc with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLC-LLM
How to use xpol555/sm-coder-mlc with MLC-LLM:
# No code snippets available yet for this library. # To use this model, check the repository files and the library's documentation. # Want to help? PRs adding snippets are welcome at: # https://github.com/huggingface/huggingface.js
- Notebooks
- Google Colab
- Kaggle
Upload model README
Browse files
README.md
CHANGED
|
@@ -1,3 +1,109 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: Qwen/Qwen2.5-Coder-1.5B-Instruct
|
| 6 |
+
base_model_relation: quantized
|
| 7 |
+
tags:
|
| 8 |
+
- supermongo
|
| 9 |
+
- astronomy
|
| 10 |
+
- code-generation
|
| 11 |
+
- scientific-plotting
|
| 12 |
+
- webllm
|
| 13 |
+
pipeline_tag: text-generation
|
| 14 |
+
library_name: mlc-llm
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# SM Coder 1.5B — MLC (WebLLM)
|
| 18 |
+
|
| 19 |
+
A fine-tuned coding assistant for **SuperMongo (SM)** macro development,
|
| 20 |
+
quantized to **q4f16_1** for browser inference via
|
| 21 |
+
[WebLLM](https://github.com/mlc-ai/web-llm).
|
| 22 |
+
|
| 23 |
+
## Usage with WebLLM
|
| 24 |
+
|
| 25 |
+
This repo contains only the quantized **weights** and `mlc-chat-config.json`.
|
| 26 |
+
Because the model uses the standard **Qwen2** architecture with **q4f16_1**
|
| 27 |
+
quantization, the pre-built wasm library shipped by `@mlc-ai/web-llm` works
|
| 28 |
+
out of the box — no custom compile step is needed.
|
| 29 |
+
|
| 30 |
+
```ts
|
| 31 |
+
import { CreateMLCEngine, prebuiltAppConfig } from "@mlc-ai/web-llm";
|
| 32 |
+
|
| 33 |
+
const engine = await CreateMLCEngine("xpol555/sm-coder-mlc", {
|
| 34 |
+
appConfig: {
|
| 35 |
+
...prebuiltAppConfig,
|
| 36 |
+
model_list: [
|
| 37 |
+
...prebuiltAppConfig.model_list,
|
| 38 |
+
{
|
| 39 |
+
model: "https://huggingface.co/xpol555/sm-coder-mlc/resolve/main/weights/",
|
| 40 |
+
model_id: "xpol555/sm-coder-mlc",
|
| 41 |
+
model_lib:
|
| 42 |
+
prebuiltAppConfig.model_list.find(
|
| 43 |
+
(m) => m.model_id === "Qwen2.5-1.5B-Instruct-q4f16_1-MLC"
|
| 44 |
+
)!.model_lib,
|
| 45 |
+
},
|
| 46 |
+
],
|
| 47 |
+
},
|
| 48 |
+
});
|
| 49 |
+
|
| 50 |
+
const reply = await engine.chat.completions.create({
|
| 51 |
+
messages: [{ role: "user", content: "Write an SM macro to draw error bars" }],
|
| 52 |
+
});
|
| 53 |
+
console.log(reply.choices[0].message.content);
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
## Base Model
|
| 57 |
+
|
| 58 |
+
[Qwen/Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct),
|
| 59 |
+
fine-tuned on a curated dataset of SM macros and related examples collected
|
| 60 |
+
over ~20 years of real scientific usage.
|
| 61 |
+
|
| 62 |
+
## What Is SuperMongo
|
| 63 |
+
|
| 64 |
+
SuperMongo is a plotting and data-analysis environment widely used in
|
| 65 |
+
astronomy and scientific workflows.
|
| 66 |
+
|
| 67 |
+
Reference: <https://www.astro.princeton.edu/~rhl/sm/>
|
| 68 |
+
|
| 69 |
+
## Intended Use
|
| 70 |
+
|
| 71 |
+
- Writing and refactoring SuperMongo macros.
|
| 72 |
+
- Translating plotting requests into SM macro skeletons.
|
| 73 |
+
- Helping document and modernize legacy macro collections.
|
| 74 |
+
|
| 75 |
+
## Limitations
|
| 76 |
+
|
| 77 |
+
- Not a general-purpose chatbot.
|
| 78 |
+
- Not an authoritative source on non-SM domains.
|
| 79 |
+
- Always validate generated macros against your SM version and local macro
|
| 80 |
+
library before use.
|
| 81 |
+
|
| 82 |
+
## Example Output
|
| 83 |
+
|
| 84 |
+
The model produces macros in standard SM syntax (positional `$1 $2 …`
|
| 85 |
+
parameters, `set` for vectors, `define` for scalars):
|
| 86 |
+
|
| 87 |
+
```
|
| 88 |
+
draw_circle 4 ## draw a circle centred at ($1,$2) radius $3 with $4 points
|
| 89 |
+
set _th = 2*PI*indgen($4)/$4
|
| 90 |
+
set _cx = $1 + $3*COS(_th)
|
| 91 |
+
set _cy = $2 + $3*SIN(_th)
|
| 92 |
+
connect _cx _cy
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
```
|
| 96 |
+
quickplot 1 ## read two-column file $1, auto-scale, and plot
|
| 97 |
+
data $1
|
| 98 |
+
read {x 1 y 2}
|
| 99 |
+
limits x y
|
| 100 |
+
erase
|
| 101 |
+
box
|
| 102 |
+
connect x y
|
| 103 |
+
xlabel Column 1
|
| 104 |
+
ylabel Column 2
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
## Other Formats
|
| 108 |
+
|
| 109 |
+
- **GGUF (Ollama / llama.cpp):** <https://huggingface.co/xpol555/sm-coder-gguf>
|