Skip to content

Commit

Permalink
Revert "feat: add function to download models directly"
Browse files Browse the repository at this point in the history
This reverts commit 5cc6624.
  • Loading branch information
ChetanXpro committed Aug 2, 2023
1 parent 5cc6624 commit 954bcd6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nodejs-whisper",
"version": "0.0.10",
"version": "0.0.8",
"description": "Node bindings for OpenAI's Whisper. Optimized for CPU.",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
18 changes: 0 additions & 18 deletions src/downloadModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,24 +36,6 @@ export default async function downloadModel() {
try {
shell.cd(path.join(__dirname, '..', './cpp/whisper.cpp/models'))

const args = process.argv.slice(2)
if (args.length > 0) {
const modelName = args[0]
console.log('Downloading model:', modelName)
if (!MODELS_LIST.includes(modelName)) {
throw `[Nodejs-whisper] Error: Model name not found. Check your spelling.`
}
let scriptPath = './download-ggml-model.sh'

if (process.platform === 'win32') scriptPath = 'download-ggml-model.cmd'
shell.chmod('+x', scriptPath)
shell.exec(`${scriptPath} ${modelName}`)
console.log('[Nodejs-whisper] Attempting to compile model...\n')
shell.cd('../')
shell.exec('make')
process.exit(0)
}

let anyModelExist = []

MODELS.forEach(model => {
Expand Down

0 comments on commit 954bcd6

Please sign in to comment.