Commit fb5edeea authored by 周成波's avatar 周成波

进一步简化选择角色的任务,强制穿衣服,更新英文版

parent 5dab215b
......@@ -20,6 +20,7 @@ const form = reactive({
chatgpt_prompt: "",
chatgpt_answer: "",
chatgpt_answer_roles: <Wm.RolesItem[]>[],
all_roles: "",
adapt_result_json: <Wm.ScriptsItem[]>[],
task_id: "",
final_video: "",
......@@ -82,10 +83,10 @@ const onAdaptRoles = async () => {
const adapt_restrict = `
指令:
请理解这个故事,给出这个故事中的所有角色,多个角色以逗号分隔`;
let roles = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
roles = roles.replace(/。/g, '').replace(/、/g, ',')
console.log(roles)
const roles_arr = roles.split(/[,,]/);
const roles = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
form.all_roles = roles.replace(/。/g, '').replace(/、/g, ',')
console.log(form.all_roles)
const roles_arr = form.all_roles.split(/[,,]/);
console.log(roles_arr)
async function processRoles() {
......@@ -99,7 +100,7 @@ const onAdaptRoles = async () => {
要求:
关键词以逗号分隔。
只要返回关键词,不需要其他的说明文字。`;
let keywords = await text2videoService.submitGpt(form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
let keywords = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
keywords = keywords.replace(/。/g, '').replace(/、/g, ',')
form.chatgpt_answer_roles.push({
"角色": one_role.trim(),
......@@ -210,7 +211,7 @@ const onAdaptOne = async (item: any) => {
const adapt_role_restrict = `
指令:
请理解这个故事,针对其中的这个场景:“${item.场景描述}”,从所有角色中选择本场景的角色,多个角色以逗号分隔。`;
const item_roles = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n所有角色:\n"+ JSON.stringify(form.chatgpt_answer_roles)+"\n" + adapt_role_restrict, tuili_llm);
const item_roles = await text2videoService.submitGpt("故事:\n" + form.chatgpt_answer + "\n所有角色:\n"+ form.all_roles +"\n" + adapt_role_restrict, tuili_llm);
// console.log(role_keywords)
if (form.chatgpt_answer_roles.length === 0) {
// 总角色为空
......
......@@ -20,6 +20,7 @@ const form = reactive({
chatgpt_prompt: "",
chatgpt_answer: "",
chatgpt_answer_roles: <Wm.RolesItem[]>[],
all_roles: "",
adapt_result_json: <Wm.ScriptsItem[]>[],
task_id: "",
final_video: "",
......@@ -82,10 +83,10 @@ const onAdaptRoles = async () => {
const adapt_restrict = `
Instructions:
Please understand this story and provide all the characters in it, with multiple characters separated by commas`;
let roles = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
roles = roles.replace(/。/g, '').replace(/、/g, ',')
console.log(roles)
const roles_arr = roles.split(/[,,]/);
const roles = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n" + adapt_restrict, role_llm);
form.all_roles = roles.replace(/。/g, '').replace(/、/g, ',')
console.log(form.all_roles)
const roles_arr = form.all_roles.split(/[,,]/);
console.log(roles_arr)
async function processRoles() {
......@@ -99,7 +100,7 @@ const onAdaptRoles = async () => {
Requirement:
Keywords are separated by commas.
As long as the keyword is returned, no additional explanatory text is required.`;
let keywords = await text2videoService.submitGpt(form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
let keywords = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n" + adapt_keyword_restrict, role_keywords_llm);
keywords = keywords.replace(/。/g, '').replace(/、/g, ',')
form.chatgpt_answer_roles.push({
"角色": one_role.trim(),
......@@ -209,8 +210,8 @@ const onAdaptOne = async (item: any) => {
const adapt_role_restrict = `
Instructions:
Please understand this story and for the scene: "${item.场景描述}", select the character in this scene from all the characters, with multiple characters separated by commas.`;
const item_roles = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\n all the characters: \n"+ JSON.stringify(form.chatgpt_answer_roles)+"\n" + adapt_role_restrict, tuili_llm);
Please understand this story and for the scene: "${item.场景描述}", select the character in this scene from characters, with multiple characters separated by commas.`;
const item_roles = await text2videoService.submitGpt("story:\n" + form.chatgpt_answer + "\ncharacters:\n"+ form.all_roles +"\n" + adapt_role_restrict, tuili_llm);
// console.log(role_keywords)
if (form.chatgpt_answer_roles.length === 0) {
// 总角色为空
......@@ -412,7 +413,7 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
<el-form-item>
<div>
<el-radio-group v-model="form.screen" @change="onChangeScreen">
<!-- <el-radio label="横屏" size="large" border/> -->
<el-radio label="横屏" size="large" border/>
<el-radio label="竖屏" size="large" border/>
</el-radio-group>
</div>
......@@ -421,12 +422,12 @@ const handleExceed: UploadProps['onExceed'] = (files) => {
<el-button type="success" @click="clean_demo">清除所有数据</el-button>
</el-form-item>
<!-- Prompt到文案 -->
<!-- <el-form-item label="Prompt">
<el-form-item label="Prompt">
<el-input v-model="form.chatgpt_prompt" :autosize="true" type="textarea" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmitGpt">生成文案({{wenan_llm_name}}</el-button>
</el-form-item> -->
</el-form-item>
<el-form-item label="文案">
<el-input v-model="form.chatgpt_answer" :autosize="true" type="textarea" />
</el-form-item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment