Podgenaiは、GPT-4 LLMを使用して、特定のトピックに情報スピーカーオーディオブック/ポッドキャストMP3ファイルを生成するためのPython 3.12アプリケーションです。生成された期間は異なりますが、生成されたファイルのターゲット期間は1時間です。資金提供された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):アプローチとアルゴリズム | 非階層的な平坦化されたシングルレベルのサブトピックリスト施行 |
| 女性 | 人間の循環系(遵守されていない) | 遵守されていない接尾辞の暗黙のトピックサポート |
| 女性 | バフィーザヴァンパイアスレイヤー | 女性の音声選択 |
| 男 | オタクのビットコイン | 男性の声の選択 |
OPENAI_API_KEY=<your OpenAI API key>を使用して、 .envという名前のファイルを作成するか、別の方法で設定します。PODGENAI_OPENAI_MAX_WORKERS=32より高速な世代の場合も設定します。デフォルト値は16です。ffmpeg利用可能であることを確認してください。これは、含まれているDevContainer定義を使用している場合に自動です。ryeがインストールされ、利用可能であることを確認してください。rye sync --no-lockを実行します。pip install -U podgenai 。 使用法は、コマンドラインアプリケーションとして、またはPythonライブラリとしてです。デフォルトでは、生成されたmp3ファイルは現在の作業ディレクトリに書き込まれます。 2024年の時点で、世代あたりの典型的なコストは1〜2 USDで、より具体的にはサブトピックあたり0.10 USD未満です。時間は3分以内です。
./work/<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>ディレクトリのディスク上でローカルにキャッシュされています。手動で削除できます。この削除は現在自動ではありません。さらに、キャッシュをバイパスする場合、1つまたは複数の適用可能なキャッシュファイルを削除する必要があることがあります。
このソフトウェアは、商品性、特定の目的への適合性、および非侵害の保証を含むがこれらに限定されない、明示的または黙示的ないかなる種類の保証もなく、「現状のまま」提供されます。いかなる場合でも、契約、不法行為、またはその他、ソフトウェアまたはソフトウェアの使用またはその他の取引に関連する、またはその他の契約の措置において、著者または著作権所有者は、請求、損害、またはその他の責任に対して責任を負いません。
ユーザーは、生成されたファイルのテキストとオーディオの両方が、指定された入力と生成時にAIモデルが利用できるデータに基づいて人工知能(AI)によって生成されることに注意する必要があります。そのため、不正確、エラー、または意図しないコンテンツが発生する可能性があります。ユーザーは、使用または信頼の前に、注意を払って生成されたコンテンツの正確性と適切性を確認することをお勧めします。
お客様は、ソフトウェアで要求されるOpenai APIの使用に関連するコストについて責任を負い、Openai APIサービスの利用規約に準拠する必要があります。ソフトウェアの機能は、著者が制御できないOpenai APIとFFMPEGを含むがこれらに限定されない外部サービスとソフトウェアの可用性と機能に依存しています。
OpenAI APIキーと生成されたコンテンツの使用は、著作権法やOpenaiプラットフォームの利用規約など、適用されるすべての法律および規制に準拠する必要があります。お客様は、ソフトウェアと生成されたコンテンツの使用が、Openaiサービスおよびその他の適用される法律および規制に準拠することを保証することに責任を負います。
このソフトウェアは、LGPLに記載されている条件に従って、GNU Lesser General Public License(LGPL)に基づいてライセンスされています。このプログラムとともに、GNU Lesser一般公開ライセンスのコピーを受け取る必要があります。そうでない場合は、http://www.gnu.org/licenses/を参照してください。
著者は、このソフトウェアを使用して生成されたコンテンツの所有権を請求していません。生成されたすべてのコンテンツを使用する責任は、ユーザーにかかっています。ユーザーは、生成されたコンテンツが第三者の権利を侵害しないように注意とデューデリジェンスを行使する必要があります。
この免責事項は、予告なしに変更される場合があります。更新のために定期的にレビューするのはあなたの責任です。