58 lines
1.7 KiB
Markdown
58 lines
1.7 KiB
Markdown
---
|
|
language: en
|
|
license: apache-2.0
|
|
library_name: transformers
|
|
tags:
|
|
- smollm2
|
|
- lora
|
|
- portfolio-assistant
|
|
- transformers.js
|
|
- webgpu
|
|
base_model: HuggingFaceTB/SmolLM2-360M-Instruct
|
|
pipeline_tag: text-generation
|
|
---
|
|
|
|
# Axon — SmolLM2-360M Portfolio Assistant
|
|
|
|
Fine-tuned [SmolLM2-360M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-360M-Instruct) to serve as a personal portfolio AI assistant. Runs entirely in the browser via WebGPU + Transformers.js.
|
|
|
|
## What is Axon?
|
|
|
|
Axon is a client-side AI assistant embedded in a Three.js 3D portfolio website. It answers questions about the portfolio owner (Akshay Mhaskar) — work experience, skills, projects, and contact info. Zero backend, zero API costs, fully private.
|
|
|
|
## Training
|
|
|
|
- **Method:** LoRA (rank=32, alpha=64) fine-tuning via TRL SFTTrainer
|
|
- **Dataset:** 1,001 curated chat examples (knowledge Q&A, refusal training, edge cases)
|
|
- **Hardware:** NVIDIA RTX 5090
|
|
- **Base model:** SmolLM2-360M-Instruct
|
|
- **Precision:** bf16
|
|
- **Train loss:** 1.33
|
|
- **Eval loss:** 0.94
|
|
- **Token accuracy:** 80%
|
|
- **Training time:** 6 minutes
|
|
|
|
## Usage (Browser — Transformers.js)
|
|
|
|
```javascript
|
|
import { pipeline } from '@huggingface/transformers';
|
|
|
|
const generator = await pipeline('text-generation', 'celestialcreator/axon-smollm2-360m', {
|
|
dtype: 'q4f16',
|
|
device: 'webgpu',
|
|
});
|
|
|
|
const result = await generator([
|
|
{ role: 'user', content: 'Who is Akshay?' }
|
|
], { max_new_tokens: 150 });
|
|
```
|
|
|
|
## Usage (Python)
|
|
|
|
```python
|
|
from transformers import pipeline
|
|
|
|
pipe = pipeline("text-generation", model="celestialcreator/axon-smollm2-360m")
|
|
result = pipe([{"role": "user", "content": "Who is Akshay?"}], max_new_tokens=150)
|
|
```
|