Duix.Heygem icon indicating copy to clipboard operation
Duix.Heygem copied to clipboard

Error: Error invoking remote method 'model/addModel': TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null 这是什么问题?怎么解决呢

Open benzo970210 opened this issue 8 months ago • 6 comments

Error: Error invoking remote method 'model/addModel': TypeError: SQLite3 can only bind numbers, strings, bigints, buffers, and null 这是什么问题?怎么解决呢

benzo970210 avatar Apr 15 '25 09:04 benzo970210

2025-04-15 17:28:27 [debug] ENV: production-win32 2025-04-15 17:28:27 [info] FFmpeg path: C:\Program Files\HeyGem\resources\app.asar.unpacked\resources\ffmpeg\win-amd64\bin\ffmpeg.exe 2025-04-15 17:28:27 [info] FFprobe path: C:\Program Files\HeyGem\resources\app.asar.unpacked\resources\ffmpeg\win-amd64\bin\ffprobe.exe 2025-04-15 17:28:27 [info] [DB] Connected: C:\Users\Admin\AppData\Roaming\heygem.ai\biz.db 2025-04-15 17:28:27 [debug] [SQL Get]: select val from context where key = ? [ 'db_version' ] 2025-04-15 17:28:27 [debug] [SQL Get]: select val from context where key = ? [ 'lang' ] 2025-04-15 17:28:27 [debug] [SQL Run]: update context set val = ? where key = ? [ 'zh', 'lang' ] 2025-04-15 17:28:27 [debug] [SQL Get]: select val from context where key = ? [ 'is_agree' ] 2025-04-15 17:28:27 [debug] [SQL Get]: SELECT COUNT() as total FROM f2f_model WHERE name like '%%' [] 2025-04-15 17:28:27 [debug] [SQL All]: SELECT * FROM f2f_model WHERE name like '%%' ORDER BY created_at DESC LIMIT 10 OFFSET 0 [] 2025-04-15 17:28:27 [debug] [SQL Get]: SELECT COUNT() as total FROM f2f_model WHERE name like '%%' [] 2025-04-15 17:28:29 [debug] [SQL Get]: SELECT COUNT() as total FROM f2f_model WHERE name like '%%' [] 2025-04-15 17:28:29 [debug] [SQL All]: SELECT * FROM f2f_model WHERE name like '%%' ORDER BY created_at DESC LIMIT 100 OFFSET 0 [] 2025-04-15 17:28:41 [info] audio split done 2025-04-15 17:28:41 [debug] ~ preprocessAndTran ~ param: {"format":"wav","reference_audio":"origin_audio/20250415172841281.wav","lang":"zh"} 2025-04-15 17:28:41 [debug] ~ train ~ res: { code: -1, msg: 'file not exists' } 2025-04-15 17:28:41 [debug] [SQL Run]: INSERT INTO f2f_model (name, video_path, audio_path, voice_id, created_at) VALUES (?, ?, ?, ?, ?) [ 'tz', '20250415172841281.mp4', 'origin_audio\20250415172841281.wav', false, 1744709321904 ] 2025-04-15 17:28:45 [debug] [SQL Get]: SELECT COUNT() as total FROM f2f_model WHERE name like '%%' [] 2025-04-15 17:28:45 [debug] [SQL All]: SELECT * FROM f2f_model WHERE name like '%%' ORDER BY created_at DESC LIMIT 10 OFFSET 0 [] 2025-04-15 17:28:45 [debug] [SQL Get]: SELECT COUNT(*) as total FROM f2f_model WHERE name like '%%' []

benzo970210 avatar Apr 15 '25 09:04 benzo970210

找到问题了,wsl 默认为内存的一半,改一下就好了

benzo970210 avatar Apr 15 '25 09:04 benzo970210

同样的问题,在哪里修改求指教

yunhehe avatar Apr 15 '25 13:04 yunhehe

同样的问题,在Ubuntu部署的服务器和客户端

2308087369 avatar Apr 17 '25 07:04 2308087369

@yunhehe https://blog.csdn.net/weixin_43135178/article/details/133586624

whl88 avatar Apr 18 '25 01:04 whl88

This fixed - "HeyGem.ai\src\main\dao\f2f-model.js" replace with below code


import { connect } from '../db/index.js'

export function insert({ modelName, videoPath, audioPath, voiceId }) {
  const db = connect()
  const stmt = db.prepare(
    'INSERT INTO f2f_model (name, video_path, audio_path, voice_id, created_at) VALUES (?, ?, ?, ?, ?)'
  )
  // Convert boolean voiceId to integer (0 for false, 1 for true)
  const voiceIdInt = voiceId === false ? 0 : (voiceId === true ? 1 : voiceId)
  const info = stmt.run(modelName, videoPath, audioPath, voiceIdInt, Date.now())
  return info.lastInsertRowid
}

export function selectPage({ page, pageSize, name = '' }) {
  const db = connect()
  const offset = (page - 1) * pageSize
  const rows = db
    .prepare(
      `SELECT * FROM f2f_model WHERE name like '%${name}%' ORDER BY created_at DESC LIMIT ${pageSize} OFFSET ${offset}`
    )
    .all()
  return rows
}

export function count(name = '') {
  const db = connect()
  const rows = db
    .prepare(`SELECT COUNT(*) as total FROM f2f_model WHERE name like '%${name}%'`)
    .get()
  return rows.total
}

export function selectByID(id) {
  const db = connect()
  const stmt = db.prepare('SELECT * FROM f2f_model WHERE id = ?')
  const row = stmt.get(id)
  return row
}

export function remove(id) {
  const db = connect()
  db.prepare(`DELETE FROM f2f_model WHERE id = ?`).run(id)
}

Bhargav-Ravinuthala avatar Apr 18 '25 09:04 Bhargav-Ravinuthala