Update app.py
Browse files
app.py
CHANGED
@@ -67,12 +67,12 @@ def summarize_video(file_path):
|
|
67 |
messages=[
|
68 |
{
|
69 |
"role": "system",
|
70 |
-
"content": """你是一位優秀的摘要撰寫者。請根據提供的影片及其文字轉錄內容撰寫一份 Markdown
|
71 |
},
|
72 |
{
|
73 |
"role": "user",
|
74 |
"content": [
|
75 |
-
"
|
76 |
*map(
|
77 |
lambda x: {
|
78 |
"type": "image_url",
|
@@ -85,7 +85,7 @@ def summarize_video(file_path):
|
|
85 |
),
|
86 |
{
|
87 |
"type": "text",
|
88 |
-
"text": f"
|
89 |
},
|
90 |
],
|
91 |
},
|
@@ -102,7 +102,7 @@ demo = gr.Interface(
|
|
102 |
inputs=[gr.File(label="上傳影片 (mp4)")],
|
103 |
outputs="markdown",
|
104 |
title="影片摘要生成器",
|
105 |
-
description="
|
106 |
)
|
107 |
|
108 |
if __name__ == "__main__":
|
|
|
67 |
messages=[
|
68 |
{
|
69 |
"role": "system",
|
70 |
+
"content": """你是一位優秀的摘要撰寫者。請根據提供的影片及其文字轉錄內容撰寫一份 Markdown 格式的摘要。""",
|
71 |
},
|
72 |
{
|
73 |
"role": "user",
|
74 |
"content": [
|
75 |
+
"這些是從影片中獲取的幀圖片",
|
76 |
*map(
|
77 |
lambda x: {
|
78 |
"type": "image_url",
|
|
|
85 |
),
|
86 |
{
|
87 |
"type": "text",
|
88 |
+
"text": f"這是影片的文字轉錄內容: {transcription.text}",
|
89 |
},
|
90 |
],
|
91 |
},
|
|
|
102 |
inputs=[gr.File(label="上傳影片 (mp4)")],
|
103 |
outputs="markdown",
|
104 |
title="影片摘要生成器",
|
105 |
+
description="上傳影片並將會生成摘要。",
|
106 |
)
|
107 |
|
108 |
if __name__ == "__main__":
|