Downloads · 30 days
4
3% of all-time downloads
danieldraus/Phi-3.5-mini-ONNX-INT4
Phi-3.5-mini-ONNX-INT4 is a machine learning model from danieldraus. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This folder contains a browser-focused ONNX version of microsoft/Phi-3.5-mini-instruct, prepared for WebGPU inference with Transformers.js.
Downloads · 30 days
4
3% of all-time downloads
All-time downloads
137
Public
Repo size
2.3 GB
Likes
0
Public
Click a slice to open those files.
.data4.6 GB · 99%
From the Hugging Face model README
This folder contains a browser-focused ONNX version of microsoft/Phi-3.5-mini-instruct, prepared for WebGPU inference with Transformers.js.
Transformers.js expects model weights under an onnx/ subfolder and tokenizer/config files at the model root.
phi3_5_webgpu_int4/
├── onnx/
│ ├── model.onnx
│ └── model.onnx_data
├── config.json
├── generation_config.json
├── special_tokens_map.json
├── tokenizer.json
└── tokenizer_config.json
npm install @xenova/transformers
Use the folder path (or hosted URL) as the model identifier.
import { pipeline } from '@xenova/transformers';
const generator = await pipeline('text-generation', './phi3_5_webgpu_int4', {
device: 'webgpu',
});
const prompt = 'You are a helpful assistant. Explain what WebGPU is in two sentences.';
const output = await generator(prompt, {
max_new_tokens: 128,
temperature: 0.7,
top_p: 0.9,
do_sample: true,
});
console.log(output[0].generated_text);
For instruction/chat behavior, pass a prompt that includes role context and user intent.
const chatPrompt = [
'System: You are concise and technical.',
'User: Give me 3 practical tips to reduce JavaScript bundle size.',
'Assistant:'
].join('\n');
const chatOut = await generator(chatPrompt, {
max_new_tokens: 160,
temperature: 0.6,
top_p: 0.9,
});
This repository is licensed under the Apache License 2.0. See the root LICENSE file.
Portions of this repository (specifically the model weights and network architecture config) are derived from Microsoft's Phi-3.5-mini-instruct model, which is licensed under the MIT License.