Download src/generator/generator_cli.js from htaf/distill-pipeline: direct link, hf CLI and curl.
- Browser
- Download file 748 Bytes
-
https://huggingface.co/htaf/distill-pipeline/resolve/main/src/generator/generator_cli.js
- Command line
-
hf download hf://htaf/distill-pipeline/src/generator/generator_cli.js
-
curl -L -o generator_cli.js https://huggingface.co/htaf/distill-pipeline/resolve/main/src/generator/generator_cli.js
748 Bytes
| import dotenv from 'dotenv'; | |
| dotenv.config(); | |
| import { runGenerator } from ../generator/generator_core.mjs'; | |
| import { hybridSearch } from '../retrieval/retrieval.mjs'; | |
| import { createProvider } from '../src/providers/provider.mjs'; | |
| async function main() { | |
| const query = process.argv.slice(2).join(" "); | |
| if (!query) { | |
| console.error("Usage: node generator.js \"your question\""); | |
| process.exit(1); | |
| } | |
| const provider = createProvider(process.env.GENERATOR_MODEL); | |
| const context = await hybridSearch(query, 5); | |
| const result = await runGenerator(query, context, provider); | |
| console.log(JSON.stringify(result, null, 2)); | |
| } | |
| main().catch(err => { | |
| console.error("Generator error:", err); | |
| process.exit(1); | |
| }); | |