Skip to content

Make videos on the computer you already own. FreeVideo runs MiniMax H3 in as little as 8 GB of VRAM and 16 GB of RAM, and adapts its acceleration path to your hardware.

Rewrite Agent chat wording: plain failure reasons, next steps name the button

Bowen Xuec8b1c4885901
diff --git a/freevideo_engine/agent/errors.py b/freevideo_engine/agent/errors.py
index 4acf7bf..79a676c 100644
--- a/freevideo_engine/agent/errors.py
+++ b/freevideo_engine/agent/errors.py
@@ -130,9 +130,9 @@ IMAGE_REASONS = {
'worker_exit': ('Image generation stopped unexpectedly. Try again.', '图像生成意外停止了,请再试一次。'),
'timeout': ('This image took too long and was stopped. Try again.', '这一张用时太长,已停止。请再试一次。'),
'generation_failed': ('Image generation ran into an error. Try again.', '图像生成出错了,请再试一次。'),
- 'invalid_media': ('A reference picture is missing or cannot be read. Choose a readable picture.',
- '参考图片不存在或读不出来,请选择可读取的图片。'),
- 'invalid_request': ('The picture settings are invalid. Check them and try again.', '图片参数不合法,请检查后重试。'),
+ 'invalid_media': ('The reference image could not be read. Choose another one.',
+ '参考图读不出来,请换一张。'),
+ 'invalid_request': ('The image settings are invalid. Adjust them and try again.', '图片设置有误,请调整后重试。'),
'busy': ('Another picture is being generated. Try again when it finishes.', '已有一张图在生成,完成后再试。'),
'cancelled': ('The picture was cancelled.', '已取消这张图片。'),
}
@@ -260,14 +260,14 @@ FAILURE_REASONS_ZH = {
'not_ready': '生成所需的环境还没有安装好',
'cancelled': '生成已被停止',
'stopped_by_user': '生成已被停止',
- 'interrupted': '生成服务中途重启,任务被打断',
- 'worker_exit': '图片生成进程中途退出',
+ 'interrupted': '生成中途被打断',
+ 'worker_exit': '图片生成中途被打断',
'closed': '图片生成服务已经关闭',
'image_unavailable': '图片生成服务还没有启动',
'vlm_unavailable': '读取画面的模型服务还没有启动',
- 'vlm_failed': '读取画面的模型没有完成请求',
- 'vlm_invalid_json': '模型返回的结果格式无法读取',
- 'context_length': '描述和参考图超过了模型可读取的长度',
+ 'vlm_failed': '没能读出画面',
+ 'vlm_invalid_json': '回复读不出来',
+ 'context_length': '描述和参考图太长',
'dependency_failed': '前面依赖的任务没有完成',
'lost': '生成服务没有保留这次任务的结果',
'unknown_job': '图片生成服务找不到这次任务',
@@ -280,11 +280,11 @@ FAILURE_REASONS_ZH = {
'invalid_output': '生成的结果无法读取或保存',
'storage_unavailable': '任务记录或素材无法写入磁盘',
'submit_interrupted': '提交生成时服务中断,尚未确认任务是否开始',
- 'timeout': '生成等待超时',
+ 'timeout': '生成等了太久没有结果',
'invalid_media': '参考素材无法读取',
'clip_unreadable': '生成的角色参考视频无法读取',
'invalid_request': '生成参数不符合支持的范围',
- 'invalid_drama': '短剧计划中有无法使用的参数',
+ 'invalid_drama': '短剧设置有误',
'reshoot_limit': '这个镜头已达到可生成的次数上限',
'production_limit': '这部短剧已达到可生成的任务数量上限',
'export_failed': '导出成片时出错',
@@ -293,8 +293,8 @@ FAILURE_REASONS_ZH = {
'too_many_images': '参考图片数量超过了支持的范围',
'chain_too_long': '接续后的视频超过了支持的段数',
'chain_rejected': '生成服务无法使用这组参数',
- 'generation_failed': '生成过程中出错,未能完成结果',
- 'internal_error': '处理任务时出错,未能完成结果',
+ 'generation_failed': '生成没有完成',
+ 'internal_error': '没有完成',
}
FAILURE_MESSAGES_ZH = {
'The previous video is too short to continue; it needs to be at least 2 s long.': '接续的上一段视频太短,至少需要 2 秒',
@@ -317,7 +317,7 @@ def failure_reason(error):
return FAILURE_MESSAGES_ZH[line]
if line.startswith(('CUDA out of memory', 'MPS backend out of memory')):
return FAILURE_REASONS_ZH['out_of_memory']
- return FAILURE_REASONS_ZH.get(error.get('code'), '处理任务时出错,未能完成结果')
+ return FAILURE_REASONS_ZH.get(error.get('code'), '没有完成')
def with_reason(error):
diff --git a/freevideo_engine/image_gen/failure.py b/freevideo_engine/image_gen/failure.py
index 700c05c..0035919 100644
--- a/freevideo_engine/image_gen/failure.py
+++ b/freevideo_engine/image_gen/failure.py
@@ -28,7 +28,7 @@ MESSAGE_ZH = {
'worker_exit': '图像生成意外停止了,请再试一次。',
'timeout': '这一张用时太长,已停止。请再试一次。',
'generation_failed': '图像生成出错了,请再试一次。',
- 'invalid_request': '图像参数不合法。',
+ 'invalid_request': '图片设置有误,请调整后重试。',
}
_DEVICE = re.compile(
r'cuda.*(?:initializ|device.*(?:lost|unavailable|removed)|invalid device ordinal|'
diff --git a/web/agent_activity.js b/web/agent_activity.js
index 224ca57..4c60ddf 100644
--- a/web/agent_activity.js
+++ b/web/agent_activity.js
@@ -7,7 +7,7 @@ const KINDS = {
generate: ['Generating', '生成中', 'M4 7h11a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2zm13 4 5-3v8l-5-3'],
assemble: ['Assembling', '拼接中', 'M3 6h7v12H3zM14 6h7v12h-7zM10 12h4'],
vlm: ['Checking', '检查中', 'M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12zm10 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6z'],
- enhance: ['Writing prompt', '润色提示词', 'M4 20l4-1 10-10-3-3L5 16zM14 7l3 3M18 3l1 2 2 1-2 1-1 2-1-2-2-1 2-1z'],
+ enhance: ['Enhancing prompt', '增强提示词', 'M4 20l4-1 10-10-3-3L5 16zM14 7l3 3M18 3l1 2 2 1-2 1-1 2-1-2-2-1 2-1z'],
};
const NAMES = {generate: ['Video', '视频'], assemble: ['Sequence', '成片'], vlm: ['Check', '检查'], enhance: ['Prompt', '提示词']};
@@ -37,7 +37,7 @@ function phaseText(p, t) {
if (p.phase === 'sampling' && step?.total) return step.done >= 1 ? t(`Step ${step.done} / ${step.total}`, `生成 ${step.done} / ${step.total}`) : t('Preparing', '准备中');
return {encoding: t('Reading prompt and media', '读取提示词和素材'), load: t('Loading the model', '加载模型'),
decode: t('Saving video and audio', '保存视频与音频'), starting: t('Starting', '启动中'),
- loading: t('Loading the model', '加载模型'), answering: t('Answering', '回答中'), rewriting: t('Writing', '改写中'),
+ loading: t('Loading the model', '加载模型'), answering: t('Answering', '回答中'), rewriting: t('Enhancing prompt', '增强提示词'),
assembling: t('Joining clips', '拼接片段'), 'preparing images': t('Preparing images', '准备图片'),
finishing: t('Finishing', '收尾中')}[p.phase] || '';
}
@@ -48,7 +48,7 @@ function status(job, t) {
if (job.status === 'cancelling') return t('Stopping', '正在停止');
if (job.status === 'queued') return job.progress?.queue_position
? t(`In queue · #${job.progress.queue_position}`, `排队 · 第 ${job.progress.queue_position} 位`) : t('Queued', '排队中');
- if (job.status === 'waiting') return job.waiting_for ? t('Waiting for earlier steps', '等待前序任务') : t('Waiting for the GPU', '等待显卡');
+ if (job.status === 'waiting') return job.waiting_for ? t('Waiting for earlier tasks', '等待前面的任务') : t('Waiting for the GPU', '等待显卡');
return {succeeded: t('Done', '已完成'), failed: t('Failed', '失败'), cancelled: t('Cancelled', '已取消')}[job.status] || job.status;
}
function title(job, t) {
@@ -76,7 +76,7 @@ function row(job, t, api, refresh, open, cancellationErrors) {
if (job.status === 'running' && p.remaining_seconds > 0) meta.push(left(p.remaining_seconds, t));
const reason = job.status === 'failed' && REASONS[job.error?.code];
if (reason) meta.push(t(...reason));
- else if (job.status === 'failed') meta.push(t(job.error?.message || 'The task failed.', job.error?.error_zh || '处理任务时出错,未能完成结果'));
+ else if (job.status === 'failed') meta.push(t(job.error?.message || 'Did not finish', job.error?.error_zh || '没有完成'));
if (job.project) meta.push(job.project);
const foot = el('div', 'fv-agent-foot');
const details = el('p', 'fv-agent-meta', meta.join(' · '));
@@ -90,7 +90,7 @@ function row(job, t, api, refresh, open, cancellationErrors) {
try {
const response = await retryAgentPost(api, '/freevideo/agent/activity/cancel', {id: job.id});
if (!response?.ok) {
- const message = t('Stopping failed after a retry. If still running, click again.', '停止没成功,已重试;仍在运行请再点一次');
+ const message = t('Could not stop. Click again.', '没能停止,请再点一次。');
details.textContent = message;
cancellationErrors.set(job.id, message);
} else cancellationErrors.delete(job.id);
diff --git a/web/autopilot_chat.js b/web/autopilot_chat.js
index 6be090b..c04e0c8 100644
--- a/web/autopilot_chat.js
+++ b/web/autopilot_chat.js
@@ -22,9 +22,9 @@ let chatNumber = 0;
const WORKING = ['running', 'queued', 'waiting', 'cancelling'], VIDEOS = ['generate', 'assemble'];
// What a job with no picture of its own is doing, in the reader's language.
-const QUIET = {vlm: ['Checking', '检查中'], enhance: ['Polishing', '润色中']};
+const QUIET = {vlm: ['Checking', '检查中'], enhance: ['Enhancing prompt', '增强提示词']};
const SEND_ATTEMPTS = 3, WAIT_FOR_AGENT = ['not_connected', 'not_listening'];
-const GENERIC_FAILURE_ZH = '处理任务时出错,未能完成结果';
+const GENERIC_FAILURE_ZH = '没有完成';
// A listening/connection race is queued; other 4xx refusals never repeat automatically.
const sendRefused = (error, response) => error?.code === 'session_full' || error?.retryable === false
|| response?.status >= 400 && response.status < 500 && !WAIT_FOR_AGENT.includes(error?.code);
@@ -37,8 +37,8 @@ async function sendError(response) {
function failureReason(value, t) {
const error = value.error, reason = error?.error_zh || value.error_zh;
if (error?.code === 'session_full' && (!reason || reason === GENERIC_FAILURE_ZH))
- return t('This conversation is full. Start a new chat.', '这个对话已达到消息数量上限,请新建对话');
- return t(error?.message || 'The task failed.', reason || GENERIC_FAILURE_ZH);
+ return t('This chat is full. Click "New chat".', '这个对话已满,请点“新对话”。');
+ return t(error?.message || 'Did not finish', reason || GENERIC_FAILURE_ZH);
}
export const about = (seconds, t) => seconds >= 60 ? t(`About ${Math.ceil(seconds / 60)} min`, `约 ${Math.ceil(seconds / 60)} 分钟`) : t('Under 1 min', '不到 1 分钟');
@@ -266,7 +266,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
if (draftSession === session) return;
saveDraft(); draftSession = session; input.value = drafts.get(session)?.text || ''; grow();
}
- const reason = error => error?.message || t('Connection lost', '连接中断');
+ const reason = error => error?.message || t('Connection lost. Try again.', '连接中断,请重试。');
async function requestError(response) {
const data = await response.json().catch(() => ({}));
return new Error(data.error?.message || data.error?.code || `HTTP ${response.status}`);
@@ -572,7 +572,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
ids.forEach(id => stopping.add(id)); render(); report();
const results = await Promise.all(ids.map(id => retryAgentPost(api, '/freevideo/agent/activity/cancel', {id})));
results.forEach((response, index) => { if (!response?.ok) stopping.delete(ids[index]); });
- if (results.some(response => !response?.ok)) say(t('Stopping failed after a retry. If still running, click again.', '停止没成功,已重试;仍在运行请再点一次'));
+ if (results.some(response => !response?.ok)) say(t('Could not stop. Click again.', '没能停止,请再点一次。'));
else say('');
if (!stopped) { render(); report(); void poll(); }
}
@@ -814,7 +814,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
// Before anything is said: what the agent can do, and sentences that send themselves when clicked.
function hello() {
const item = el('li', 'fv-chat-hello');
- item.append(el('p', null, t('I can make videos for you,', '我可以替你生成视频,')), el('p', null, t('or turn a story into a short film.', '也可以把一个故事拍成短片。')));
+ item.append(el('p', null, t('I can make videos for you,', '我可以为您生成视频,')), el('p', null, t('or turn a story into a short film.', '也可以把一个故事拍成短片。')));
return {element: item, update() {}};
}
function examples() {
@@ -919,8 +919,8 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
}
}
const waitingNotice = code => (code ? code === 'not_listening' : state.agent.connected === true)
- ? t('Not sent: Agent is not listening yet. It will send automatically once listening resumes.', '没发出去:Agent 还没在听,继续监听后会自动发送')
- : t('Not sent: Agent is not connected. It will send automatically once connected.', '没发出去:Agent 还没连接,连接后会自动发送');
+ ? t('Will send when Agent is back', '等 Agent 回来后自动发送')
+ : t('Will send when Agent connects', '等 Agent 连上后自动发送');
async function send(text, original = null, draft = null, automatic = false) {
text = String(text).trim();
original ||= pending.find(entry => entry.session === (state.session ?? null) && entry.text === text && (entry.error || entry.sending || entry.automatic));
@@ -959,9 +959,9 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
const exhausted = entry.attempts >= SEND_ATTEMPTS;
entry.automatic = waiting && !exhausted;
const explanation = refused || error && !waiting ? t('Not sent: ', '没发出去:') + failureReason({error}, t)
- : exhausted ? t('Not sent: tried 3 times. Automatic sending stopped; please send again.', '没发出去:已尝试 3 次,已停止自动发送,请再发一次')
- : waiting ? waitingNotice(error?.code) : t('The network is unstable. Retried; please send again.', '网络不稳,已重试,请再发一次');
- entry.error = waiting ? explanation : t('Could not send: ', '没有发送成功:') + (error?.message || explanation);
+ : exhausted ? t('Not sent. Click "Retry".', '没有发出,请点“重试”。')
+ : waiting ? waitingNotice(error?.code) : t('The connection is unstable. Click "Retry".', '网络不稳,请点“重试”。');
+ entry.error = waiting || /^(Not sent|没发出|没有发出)/.test(explanation) ? explanation : t('Could not send: ', '没有发送成功:') + explanation;
if (entry.session === state.session) {
if (waiting && error?.code === 'not_connected') state = {...state, agent: {connected: false, name: null}};
if (waiting && error?.code === 'not_listening') state = {...state, agent: {...state.agent, listening: false}};
@@ -985,7 +985,7 @@ export function agentChat(t, api, {open, edit, shown = () => true, changed = ()
// Editing a queued draft cancels its automatic delivery. Its original message remains available for manual retry.
for (const entry of pending) if (entry.automatic && entry.session === draftSession && entry.draft !== drafts.get(draftSession)) {
entry.automatic = false;
- entry.error = t('Not sent: the queued draft changed. Retry to send the original.', '没发出去:排队草稿已修改,原消息需手动重试');
+ entry.error = t('The message changed. Click "Retry" to send the original.', '消息已修改,点“重试”发送原消息。');
say('');
}
if (!input.value.trim()) say('');
diff --git a/web/image_generation.js b/web/image_generation.js
index 52fc6ef..0c58449 100644
--- a/web/image_generation.js
+++ b/web/image_generation.js
@@ -118,7 +118,7 @@ export function imageGenError(code, info, t) {
worker_exit: ['Image generation stopped unexpectedly. Try again.', '图像生成意外停止了,请再试一次。'],
timeout: ['This image took too long and was stopped. Try again.', '这一张用时太长,已停止。请再试一次。'],
cancelled: ['Image generation was cancelled.', '已取消图像生成。'],
- invalid_request: ['The image settings are invalid. Check them and try again.', '图像生成参数不合法,请检查后重试。'],
+ invalid_request: ['The image settings are invalid. Adjust them and try again.', '图片设置有误,请调整后重试。'],
invalid_media: ['The reference image cannot be read. Choose another image.', '参考图读不出来,请换一张图。'],
reload: ['The image service restarted. Try again.', '图像服务已重启,请重试。'],
generation_failed: ['Image generation ran into an error. Try again.', '图像生成出错了,请再试一次。'],