Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
T
text2video-frontend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
周成波
text2video-frontend
Commits
9f33b0ca
Commit
9f33b0ca
authored
Feb 28, 2024
by
周成波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改一下LLM接口名称
parent
fbf3035b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
1092 deletions
+16
-1092
text2videoService.ts
src/api/service/text2videoService.ts
+2
-2
index-bak20240224.vue
src/views/home/index-bak20240224.vue
+0
-540
index.vue
src/views/home/index.vue
+7
-7
index_en.vue
src/views/home/index_en.vue
+7
-7
index_en.vue.bak
src/views/home/index_en.vue.bak
+0
-536
No files found.
src/api/service/text2videoService.ts
View file @
9f33b0ca
...
...
@@ -4,12 +4,12 @@
import
request
from
'@/api/request'
export
default
{
submit
Gpt
(
prompt
:
string
,
llm
:
string
=
"gpt"
):
Promise
<
string
>
{
submit
LLM
(
prompt
:
string
,
llm
:
string
=
"gpt"
):
Promise
<
string
>
{
if
(
!
prompt
)
{
return
Promise
.
reject
(
"输入不能为空"
);
}
const
post_data
=
{
source_text
:
prompt
,
llm
:
llm
}
return
request
.
post
(
'/text2video/text2
gpt
'
,
post_data
)
return
request
.
post
(
'/text2video/text2
llm
'
,
post_data
)
.
then
((
res
:
any
)
=>
{
// console.log(res);
if
(
res
&&
res
.
code
===
0
)
{
...
...
src/views/home/index-bak20240224.vue
deleted
100644 → 0
View file @
fbf3035b
This diff is collapsed.
Click to expand it.
src/views/home/index.vue
View file @
9f33b0ca
...
...
@@ -47,7 +47,7 @@ const fanyi_llm_name = qwen.name
const
voice_rate
=
ref
(
-
15
)
const
voice_volume
=
ref
(
0
)
const
voice
=
ref
(
"zh-CN-YunjianNeural"
)
const
bgm
=
ref
(
""
)
const
bgm
=
ref
(
"
解忧曲
"
)
onMounted
(()
=>
{
...
...
@@ -59,7 +59,7 @@ const delay = (ms: any) => new Promise(res => setTimeout(res, ms));
const
onSubmitGpt
=
()
=>
{
text2videoService
.
submit
Gpt
(
form
.
chatgpt_prompt
,
wenan_llm
)
.
submit
LLM
(
form
.
chatgpt_prompt
,
wenan_llm
)
.
then
((
result
:
string
)
=>
{
console
.
log
(
form
.
chatgpt_prompt
);
console
.
log
(
result
);
...
...
@@ -89,7 +89,7 @@ const onAdaptRoles = async () => {
const
adapt_restrict
=
`
指令:
请理解这个故事,给出这个故事中的所有角色,多个角色以逗号分隔`
;
const
roles
=
await
text2videoService
.
submit
Gpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
role_llm
);
const
roles
=
await
text2videoService
.
submit
LLM
(
"故事:
\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
(
/
[
,,
]
/
);
...
...
@@ -106,7 +106,7 @@ const onAdaptRoles = async () => {
要求:
关键词以逗号分隔。
只要返回关键词,不需要其他的说明文字。`
;
let
keywords
=
await
text2videoService
.
submit
Gpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_keyword_restrict
,
role_keywords_llm
);
let
keywords
=
await
text2videoService
.
submit
LLM
(
"故事:
\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
(),
...
...
@@ -211,7 +211,7 @@ const onAdaptOne = async (item: any) => {
要求:
关键词以逗号分隔。
只要返回关键词,不需要其他的说明文字。`
;
const
keywords
=
await
text2videoService
.
submit
Gpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
tuili_llm
);
const
keywords
=
await
text2videoService
.
submit
LLM
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
tuili_llm
);
// console.log(keywords)
item
.
场景关键词
=
keywords
;
if
(
form
.
chatgpt_answer_roles
.
length
===
0
)
{
...
...
@@ -223,7 +223,7 @@ const onAdaptOne = async (item: any) => {
const
adapt_role_restrict
=
`
指令:
请理解这个故事,针对其中的这个场景:“
${
item
.
场景描述
}
”,从所有角色中选择本场景的角色,多个角色以逗号分隔。`
;
const
item_roles
=
await
text2videoService
.
submit
Gpt
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
所有角色:
\n
"
+
form
.
all_roles
+
"
\n
"
+
adapt_role_restrict
,
tuili_llm
);
const
item_roles
=
await
text2videoService
.
submit
LLM
(
"故事:
\n
"
+
form
.
chatgpt_answer
+
"
\n
所有角色:
\n
"
+
form
.
all_roles
+
"
\n
"
+
adapt_role_restrict
,
tuili_llm
);
// console.log(role_keywords)
item
.
角色
=
item_roles
;
let
role_kws
=
""
...
...
@@ -280,7 +280,7 @@ const onDrawOne = async (item: any) => {
if
(
item
.
场景关键词
)
{
temp_prompt
=
temp_prompt
+
`场景关键词为:
${
item
.
场景关键词
}
\n`
};
if
(
item
.
角色
)
{
temp_prompt
=
temp_prompt
+
`场景中的角色有:
${
item
.
角色
}
\n`
};
if
(
item
.
角色关键词
)
{
temp_prompt
=
temp_prompt
+
`角色关键词为:
${
item
.
角色关键词
}
\n`
};
const
sd_describe
=
await
text2videoService
.
submit
Gpt
(
const
sd_describe
=
await
text2videoService
.
submit
LLM
(
`
${
temp_prompt
}
指令:
请理解以上内容,并返回一段英文的描述。`
,
fanyi_llm
...
...
src/views/home/index_en.vue
View file @
9f33b0ca
...
...
@@ -47,7 +47,7 @@ const fanyi_llm_name = gpt.name
const
voice_rate
=
ref
(
-
15
)
const
voice_volume
=
ref
(
0
)
const
voice
=
ref
(
"en-US-BrianNeural"
)
const
bgm
=
ref
(
""
)
const
bgm
=
ref
(
"
解忧曲
"
)
onMounted
(()
=>
{
// 初始化示例数据
...
...
@@ -58,7 +58,7 @@ const delay = (ms: any) => new Promise(res => setTimeout(res, ms));
const
onSubmitGpt
=
()
=>
{
text2videoService
.
submit
Gpt
(
form
.
chatgpt_prompt
,
wenan_llm
)
.
submit
LLM
(
form
.
chatgpt_prompt
,
wenan_llm
)
.
then
((
result
:
string
)
=>
{
console
.
log
(
form
.
chatgpt_prompt
);
console
.
log
(
result
);
...
...
@@ -88,7 +88,7 @@ const onAdaptRoles = async () => {
const
adapt_restrict
=
`
Instructions:
Please understand this story and provide all the characters in it, with multiple characters separated by commas`
;
const
roles
=
await
text2videoService
.
submit
Gpt
(
"story:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
role_llm
);
const
roles
=
await
text2videoService
.
submit
LLM
(
"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
(
/
[
,,
]
/
);
...
...
@@ -105,7 +105,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
.
submit
Gpt
(
"story:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_keyword_restrict
,
role_keywords_llm
);
let
keywords
=
await
text2videoService
.
submit
LLM
(
"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
(),
...
...
@@ -210,7 +210,7 @@ const onAdaptOne = async (item: any) => {
Requirement:
Keywords are separated by commas.
As long as the keyword is returned, no additional explanatory text is required.`
;
const
keywords
=
await
text2videoService
.
submit
Gpt
(
"story:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
tuili_llm
);
const
keywords
=
await
text2videoService
.
submit
LLM
(
"story:
\n
"
+
form
.
chatgpt_answer
+
"
\n
"
+
adapt_restrict
,
tuili_llm
);
// console.log(keywords)
item
.
场景关键词
=
keywords
;
if
(
form
.
chatgpt_answer_roles
.
length
===
0
)
{
...
...
@@ -222,7 +222,7 @@ 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 characters, with multiple characters separated by commas.`
;
const
item_roles
=
await
text2videoService
.
submit
Gpt
(
"story:
\n
"
+
form
.
chatgpt_answer
+
"
\n
characters:
\n
"
+
form
.
all_roles
+
"
\n
"
+
adapt_role_restrict
,
tuili_llm
);
const
item_roles
=
await
text2videoService
.
submit
LLM
(
"story:
\n
"
+
form
.
chatgpt_answer
+
"
\n
characters:
\n
"
+
form
.
all_roles
+
"
\n
"
+
adapt_role_restrict
,
tuili_llm
);
// console.log(role_keywords)
item
.
角色
=
item_roles
;
let
role_kws
=
""
...
...
@@ -279,7 +279,7 @@ const onDrawOne = async (item: any) => {
if
(
item
.
场景关键词
)
{
temp_prompt
=
temp_prompt
+
`Scene keywords are:
${
item
.
场景关键词
}
\n`
};
if
(
item
.
角色
)
{
temp_prompt
=
temp_prompt
+
`Characters in the scene are:
${
item
.
角色
}
\n`
};
if
(
item
.
角色关键词
)
{
temp_prompt
=
temp_prompt
+
`Character keywords are:
${
item
.
角色关键词
}
\n`
};
const
sd_describe
=
await
text2videoService
.
submit
Gpt
(
const
sd_describe
=
await
text2videoService
.
submit
LLM
(
`
${
temp_prompt
}
Instructions:
Please understand the above content and return an English description.`
,
fanyi_llm
...
...
src/views/home/index_en.vue.bak
deleted
100644 → 0
View file @
fbf3035b
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment