// Force offline mode to prevent remote lookups. | |
process.env.HF_HUB_OFFLINE = "1"; | |
import { AutoModel } from '@xenova/transformers'; | |
async function run() { | |
// Since test_model.js is inside your model folder, | |
// use '.' to refer to the current folder. | |
const model = await AutoModel.from_pretrained('.', { localFilesOnly: true }); | |
const output = await model('Mô hình thử nghiệm'); | |
console.log(output); | |
} | |
run(); |