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 |
| Podcast | 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/。
作者不聲稱擁有使用此軟件生成的任何內容的所有權。用戶的使用負責使用任何和所有生成的內容。用戶應謹慎行事和盡職調查,以確保生成的內容不會侵犯第三方的權利。
此免責聲明如有更改,恕不另行通知。您有責任定期審查它以進行更新。