-
Notifications
You must be signed in to change notification settings - Fork 534
/
Copy pathqwen2vl_assistant_video.py
38 lines (31 loc) · 1.19 KB
/
qwen2vl_assistant_video.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from qwen_agent.agents import Assistant
def test():
bot = Assistant(llm={'model': 'qwen-vl-max-latest'})
messages = [{
'role':
'user',
'content': [{
'video': [
'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20241108/xzsgiz/football1.jpg',
'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20241108/tdescd/football2.jpg',
'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20241108/zefdja/football3.jpg',
'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20241108/aedbqh/football4.jpg'
]
}, {
'text': 'Describe the specific process of this video'
}]
}]
# Uploading video files requires applying for permission on DashScope
# messages = [{
# 'role':
# 'user',
# 'content': [{
# 'video': 'https://www.runoob.com/try/demo_source/mov_bbb.mp4'
# }, {
# 'text': 'Describe the specific process of this video'
# }]
# }]
for rsp in bot.run(messages):
print(rsp)
if __name__ == '__main__':
test()