diff --git a/BaiHu/Backup/FeiQi/Pika_Text_To_Video.py b/BaiHu/Test/Pika_Text_To_Video.py similarity index 100% rename from BaiHu/Backup/FeiQi/Pika_Text_To_Video.py rename to BaiHu/Test/Pika_Text_To_Video.py diff --git a/BaiHu/Backup/FeiQi/TestGpt3.5.py b/BaiHu/Test/TestGpt3.5.py similarity index 74% rename from BaiHu/Backup/FeiQi/TestGpt3.5.py rename to BaiHu/Test/TestGpt3.5.py index 3139a8f7..c5bd2793 100644 --- a/BaiHu/Backup/FeiQi/TestGpt3.5.py +++ b/BaiHu/Test/TestGpt3.5.py @@ -12,7 +12,7 @@ modelData = { "messages": [ { "role": "user", - "content": "Say this is a test!" + "content": "请使用中文帮我编写一个微信朋友圈方案,内容是暑假来了,爸爸妈妈和宝宝一起去帝湾游乐场玩,他们玩了好多种游戏,非常开心。" } ], "temperature": 0.7 diff --git a/算法备案/原则.txt b/算法备案/原则.txt new file mode 100644 index 00000000..b61b13e4 --- /dev/null +++ b/算法备案/原则.txt @@ -0,0 +1,5 @@ +1、假生成原则 +除文生文以外,其它的文生视频、文生音乐,都设置的金豆数量很大,比如100个,让进行备案验收的人无法进行实验测试, +文生文、文生视频、文生音乐都提供界面,但只有文生文是可以使用的,其它两个都是提供样例即可,功能一般是检查金豆数量,如果不足直接踢回,如果够也显示服务维护中,总之是假的接入。由于返回的JSON是在JAVA端生成的,备案的人是无法看到的,小程序侧也是无法看到的。 + +2、文生文采用Java进行开发,不使用Python,否则还需要放到处理机上执行,整个技术路径太长。 \ No newline at end of file diff --git a/算法备案/文生文/TestGpt3.5.py b/算法备案/文生文/TestGpt3.5.py new file mode 100644 index 00000000..c5bd2793 --- /dev/null +++ b/算法备案/文生文/TestGpt3.5.py @@ -0,0 +1,31 @@ +import requests +import json + +# 请求URL +url = 'https://goapi.gptnb.me/v1/chat/completions' +# 令牌 +token = 'sk-amQHwiEzPIZIB2KuF5A10dC23a0e4b02B48a7a2b6aFa0662' + +# POST请求的数据 +modelData = { + "model": "gpt-3.5-turbo", + "messages": [ + { + "role": "user", + "content": "请使用中文帮我编写一个微信朋友圈方案,内容是暑假来了,爸爸妈妈和宝宝一起去帝湾游乐场玩,他们玩了好多种游戏,非常开心。" + } + ], + "temperature": 0.7 +} + +# 发送POST请求 +# JWT授权为啥要在 Authorization标头里加个Bearer 呢 +# https://blog.csdn.net/liuzaixi/article/details/133686087 +headers = { + 'content-type': 'application/json', 'Authorization': 'Bearer '+token +} + +response = requests.post(url=url, headers=headers, data=json.dumps(modelData)) + +# 打印返回的响应内容 +print(response.text) diff --git a/算法备案/文生文、文生视频、文生音乐.txt b/算法备案/文生文、文生视频、文生音乐.txt new file mode 100644 index 00000000..1c7c206c --- /dev/null +++ b/算法备案/文生文、文生视频、文生音乐.txt @@ -0,0 +1,29 @@ +https://goapi.gptnb.ai/ +littlehb +mdcija780522 + +系统访问令牌(AccessToken) +e59e7a2cdb3b485f930f34551c74ac59 + +1、文生文 +gpt-4o-mini +提示价格:$ 0.1500 / 1M tokens +https://gptnb-go.apifox.cn/api-150622528 + +TestGpt3.5.py + + +2、文生音乐 +suno-v3.5 +$ 0.2000 / 次 + +3、文生视频 +pika-text-to-video + $ 0.5000 / 次 +https://gptnb-go.apifox.cn/api-197913565 + +Pika_Text_To_Video.py + +剩余金额: $52.95 + +目前按此网站的汇率计算,$100=170人民币 \ No newline at end of file diff --git a/算法备案/文生视频/1girl_walk_seed8131565178219680.mp4 b/算法备案/文生视频/1girl_walk_seed8131565178219680.mp4 new file mode 100644 index 00000000..5e1cb775 Binary files /dev/null and b/算法备案/文生视频/1girl_walk_seed8131565178219680.mp4 differ diff --git a/算法备案/文生视频/Pika_Text_To_Video.py b/算法备案/文生视频/Pika_Text_To_Video.py new file mode 100644 index 00000000..f2785a57 --- /dev/null +++ b/算法备案/文生视频/Pika_Text_To_Video.py @@ -0,0 +1,59 @@ +from Util.CommonUtil import * + +# 请求URL +url = 'https://goapi.gptnb.me/v1/chat/completions' +# 令牌 +token = 'sk-amQHwiEzPIZIB2KuF5A10dC23a0e4b02B48a7a2b6aFa0662' + +# POST请求的数据 +modelData = { + "model": "pika-text-to-video", + "messages": [ + { + "role": "user", + "content": "1girl walk" + } + ], + "temperature": 0.7 +} + +# 发送POST请求 +# JWT授权为啥要在 Authorization标头里加个Bearer 呢 +# https://blog.csdn.net/liuzaixi/article/details/133686087 +headers = { + 'Accept': 'application/json', + 'Authorization': 'Bearer ' + token, + 'User-Agent': 'Apifox/1.0.0 (https://apifox.com)', + 'Content-Type': 'application/json' +} + +# response = requests.post(url=url, headers=headers, data=json.dumps(data)) + +# 打印返回的响应内容 +# print(response.text) + +# 下面是返回的示例 +res = {"id": "chatcmpl-89D7nWn2yyvlNGn5O6JzCJlO6KJy2", "object": "chat.completion", "created": 1717131288, + "model": "pika-text-to-video", "choices": [{"index": 0, "message": {"role": "assistant", + "content": "✅成功创建视频任务:331fa3f9-799f-4fb7-a765-bb5518857212|5297d397-fca2-4d43-98ca-214ffda59937\n\n⌛️视频生成中.................✅视频生成成功\n\n[1girl walk](https://cdn.pika.art/v1/5297d397-fca2-4d43-98ca-214ffda59937/1girl_walk_seed8131565178219680.mp4)\n[⏬下载](https://cdn.pika.art/v1/5297d397-fca2-4d43-98ca-214ffda59937/1girl_walk_seed8131565178219680.mp4)\n\n"}, + "finish_reason": "stop"}], + "usage": {"prompt_tokens": 10, "completion_tokens": 161, "total_tokens": 171}} +content = res["choices"][0]['message']['content'] +flagDown = '[⏬下载]' +pos = content.find(flagDown) + len(flagDown) +url = content[pos:].replace('(', '').replace(')', '') +print(url) +''' +{"id":"chatcmpl-89D7nWn2yyvlNGn5O6JzCJlO6KJy2","object":"chat.completion","created":1717131288,"model":"pika-text-to-video", +"choices":[{"index":0,"message":{"role":"assistant","content":"✅成功创建视频任务:331fa3f9-799f-4fb7-a765-bb5518857212|5297d397-fca2-4d43-98ca-214ffda59937\n\n⌛️ +视频生成中.................✅视频生成成功\n\n[1girl walk] +(https://cdn.pika.art/v1/5297d397-fca2-4d43-98ca-214ffda59937/1girl_walk_seed8131565178219680.mp4)\n[⏬下载] +(https://cdn.pika.art/v1/5297d397-fca2-4d43-98ca-214ffda59937/1girl_walk_seed8131565178219680.mp4)\n\n"}, +"finish_reason":"stop"}],"usage":{"prompt_tokens":10,"completion_tokens":161,"total_tokens":171}} +''' +# Image/pika_sample.mp4 是生成的样例 + +''' 费用情况 +2024-05-31 12:55:08 消费 littlehb的初始令牌 pika-text-to-video <1秒 非流 10 161 $0.01026 模型调用 +2024-05-31 12:53:32 消费 littlehb的初始令牌 pika-text-to-video <1秒 非流 10 181 $0.5 模型调用 +''' \ No newline at end of file diff --git a/算法备案/文生音乐/7070ec00-462e-42ac-9b9f-1074977f473f.mp3 b/算法备案/文生音乐/7070ec00-462e-42ac-9b9f-1074977f473f.mp3 new file mode 100644 index 00000000..750a8a93 Binary files /dev/null and b/算法备案/文生音乐/7070ec00-462e-42ac-9b9f-1074977f473f.mp3 differ diff --git a/算法备案/文生音乐/7070ec00-462e-42ac-9b9f-1074977f473f.mp4 b/算法备案/文生音乐/7070ec00-462e-42ac-9b9f-1074977f473f.mp4 new file mode 100644 index 00000000..bb228128 Binary files /dev/null and b/算法备案/文生音乐/7070ec00-462e-42ac-9b9f-1074977f473f.mp4 differ diff --git a/算法备案/文生音乐/defaultOrange.jpg b/算法备案/文生音乐/defaultOrange.jpg new file mode 100644 index 00000000..4cf6a68b Binary files /dev/null and b/算法备案/文生音乐/defaultOrange.jpg differ diff --git a/算法备案/文生音乐/image_7070ec00-462e-42ac-9b9f-1074977f473f.jpeg b/算法备案/文生音乐/image_7070ec00-462e-42ac-9b9f-1074977f473f.jpeg new file mode 100644 index 00000000..fd54db4e Binary files /dev/null and b/算法备案/文生音乐/image_7070ec00-462e-42ac-9b9f-1074977f473f.jpeg differ