Download reward/rewards.js from htaf/distill-pipeline: direct link, hf CLI and curl.
- Browser
- Download file 776 Bytes
-
https://huggingface.co/htaf/distill-pipeline/resolve/main/reward/rewards.js
- Command line
-
hf download hf://htaf/distill-pipeline/reward/rewards.js
-
curl -L -o rewards.js https://huggingface.co/htaf/distill-pipeline/resolve/main/reward/rewards.js
776 Bytes
| import dotenv from 'dotenv'; | |
| dotenv.config(); | |
| import { runReward } from './reward_core.mjs'; | |
| import { createProvider } from '../src/providers/provider.mjs'; | |
| async function main() { | |
| const stdin = await new Promise((resolve) => { | |
| let data = ""; | |
| process.stdin.on("data", chunk => data += chunk); | |
| process.stdin.on("end", () => resolve(data)); | |
| }); | |
| if (!stdin.trim()) { | |
| console.error("Usage: cat verified.json | reward.js"); | |
| process.exit(1); | |
| } | |
| const sample = JSON.parse(stdin); | |
| const provider = createProvider(process.env.REWARD_MODEL); | |
| const result = await runReward(sample, provider); | |
| console.log(JSON.stringify(result, null, 2)); | |
| } | |
| main().catch(err => { | |
| console.error("Reward error:", err); | |
| process.exit(1); | |
| }); | |