Podgenai是一种Python 3.12应用程序,用于使用GPT-4 LLM在给定主题上生成信息单扬声器的有声读物/播客MP3文件。生成的文件的目标持续时间为一个小时,尽管生成的持续时间有所不同。需要一个资助的OpenAI API密钥。
| 标题 | 关联 |
|---|---|
| 仓库 | https://github.com/impredicative/podgenai |
| ChangElog | https://github.com/impredicative/podgenai/releases |
| 包裹 | https://pypi.org/project/podgenai |
| 播客 | https://podcasters.spotify.com/pod/podgenai |
| 播客RSS | https://anchor.fm/s/f4868644/podcast/rss |
使用gpt-4o和tts-1模型。对于给定的主题,高级参考方法是:
ffmpeg加入语音文件。尽管有时可能会在子主题之间进行某些内容的语义重复,但这并未故意“优化”,因为重复重要的观点可以帮助学习和记忆。要深入研究特定的亚主题,可以尝试为其创建一个新文件。
这些生成的mp3文件可供下载。实际上,这些构成了最小的手动测试套件,每个样品的独特目的。提醒您,LLM选择了声音。
还有一个相关的播客(RSS),随着时间的流逝,可能会手动发布其他主题的情节。
对于非技术主题,建议使用1.05倍的播放速度,技术主题为1.0倍,外语主题为0.95倍。
| 嗓音 | 姓名 | 目的 |
|---|---|---|
| 默认 | Pytorch | 技术内容生成 |
| 默认 | 高级Pytorch | 高级技术内容生成 |
| 默认 | 软件工程师求职提示 | 默认语音选择 |
| 情绪化 | 纽约市:现在和未来 | 非技术内容产生 |
| 情绪化 | 过上美好的生活 | 情感语音选择 |
| 默认 | 人工通用情报(AGI):方法和算法 | 非等级扁平的单级亚电场列表执行 |
| 女性 | 人类循环系统(未遗迹) | 隐性主题支持未删节的后缀 |
| 女性 | 巴菲吸血鬼杀手 | 女性语音选择 |
| 男性 | 书呆子的比特币 | 男性声音选择 |
.env的文件,使用预期的环境变量OPENAI_API_KEY=<your OpenAI API key> ,或以不同的方式进行设置。PODGENAI_OPENAI_MAX_WORKERS=32用于更快的生成,其默认值为16。ffmpeg可用。如果使用随附的devcontainer定义,这是自动的。rye并可用。rye sync --no-lock 。pip install -U podgenai 。 用法可以作为命令行应用程序或python库。默认情况下,生成的mp3文件将写入当前工作目录。截至2024年,每一代的典型成本为1至2美元,更具体地说是每次次主题0.10美元。花费的时间不到三分钟。
./work/<topic>/1.*.mp3 topic>/1.*..mp3并再生输出。--no-markers选项。使用帮助以下复制:
$ python -m podgenai -h
Usage: python -m podgenai [OPTIONS]
Generate and write an audiobook podcast mp3 file for the given topic to the given output file path.
Options:
-t, --topic TEXT Topic. If not given, the user is prompted for it.
-p, --path PATH Output file or directory path. If an intended file path, it must have an ".mp3"
suffix. If a directory, it must exist, and the file name is auto-determined. If not
given, the output file is written to the current working directory with an auto-
determined file name.
-s, --max-sections INTEGER RANGE
Maximum number of sections, between 3 and 100. If not given, it is unrestricted.
[3<=x<=100]
-m, --markers / -nm, --no-markers
Include markers at the start or end of sections in the generated audio. If
`--markers`, markers are included, and this is the default. If `--no-markers`,
markers are excluded, as can be appropriate for foreign-language generation.
-c, --confirm / -nc, --no-confirm
Confirm before full-text and speech generation. If `--confirm`, a confirmation is
interactively sought as each step of the workflow progresses, and this is the
default. If `--no-confirm`, the full-text and speech are generated without
confirmations.
-h, --help Show this message and exit.
用法示例:
$ python -m podgenai -t "My favorite topic"
$ python -m podgenai -t "My favorite topic" -p ~/Downloads/
$ python -m podgenai -t "My favorite topic" -p ~/Downloads/topic.mp3 -nc
$ python -m podgenai -t "L'histoire de Napoléon Bonaparte (français)" -nm
>> > from podgenai import generate_media
>> > import inspect
>> > print ( inspect . signature ( generate_media ))
( topic : str , * , output_path : Optional [ pathlib . Path ] = None , max_sections : Optional [ int ] = None , markers : bool = True , confirm : bool = False ) - > pathlib . Path
>> > print ( inspect . getdoc ( generate_media )) Return the output path after generating and writing an audiobook podcast to file for the given topic.
Params:
* `topic`: Topic.
* `path`: Output file or directory path.
If an intended file path, it must have an ".mp3" suffix. If a directory, it must exist, and the file name is auto-determined.
If not given, the output file is written to the repo directory with an auto-determined file name.
* `max_sections`: Maximum number of sections to generate. It is between 3 and 100. It is unrestricted if not given.
* `markers`: Include markers at the start or end of sections in the generated audio.
If true, markers are included. If false, markers are excluded, as can be appropriate for foreign-language generation. Its default is true.
* `confirm`: Confirm before full-text and speech generation.
If true, a confirmation is interactively sought after generating and printing the list of subtopics, before generating the full-text, and also before generating the speech. Its default is false.
If failed, a subclass of the `podgenai.exceptions.Error` exception is raised.
文本和语音段在./work/<topic>目录中的磁盘上本地缓存。它们可以手动删除。此删除目前不是自动的。此外,如果要绕过缓存,目前可能有必要删除一个或多个适用的缓存文件。
该软件是“原样”提供的,没有任何形式的明示或暗示保证,包括但不限于适销性,特定目的的适用性和非侵权保证。在任何情况下,作者或版权持有人均不应对任何索赔,损害赔偿或其他责任责任,无论是在合同,侵权或其他方面,是由软件,与软件中的使用或其他交易有关的。
用户应意识到,生成文件的文本和音频都是根据给出的输入以及生成时AI模型可用的数据生成的。因此,可能会发生不准确,错误或意外内容。建议用户谨慎行事,并在使用或依赖之前验证生成内容的准确性和适当性。
您应对软件要求使用OpenAI API相关的费用负责,并且必须遵守OpenAI API服务条款。该软件的功能取决于外部服务和软件的可用性和功能,包括但不限于OpenAI API和FFMPEG,作者无法控制。
使用OpenAI API密钥和任何生成的内容都必须遵守所有适用的法律法规,包括版权法和OpenAI平台的服务条款。您负责确保您对软件的使用和任何生成的内容都符合OpenAI的服务条款以及任何其他适用的法律和法规。
该软件是根据GNU较少的通用公共许可证(LGPL)许可的,该公共许可证允许在LGPL中规定的条款和条件下同时进行私人和商业用途,修改和分发。您应该已经收到了GNU较少的通用公共许可证的副本。如果没有,请参见http://www.gnu.org/licenses/。
作者不声称拥有使用此软件生成的任何内容的所有权。用户的使用负责使用任何和所有生成的内容。用户应谨慎行事和尽职调查,以确保生成的内容不会侵犯第三方的权利。
此免责声明如有更改,恕不另行通知。您有责任定期审查它以进行更新。