Downloads · 30 days
0
snappyjack/jre-podcast-demo
jre-podcast-demo is a machine learning model from snappyjack. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
本项目使用 AI 技术克隆 Joe Rogan 和 Warren Buffett 的声音和说话风格,生成播客对话。
Downloads · 30 days
0
Access
Public
Updated Apr 5, 2026
Repo size
17.1 MB
Likes
0
Public
Click a slice to open those files.
.mp317.1 MB · 100%
From the Hugging Face model README
本项目使用 AI 技术克隆 Joe Rogan 和 Warren Buffett 的声音和说话风格,生成播客对话。
本项目包含:
/workspace/
├── 📂 模型文件
│ ├── joe_rogan_lora_v2/ # Joe Rogan LoRA (500步训练)
│ │ ├── checkpoint-500/ # 最终检查点
│ │ │ ├── adapter_model.safetensors # LoRA 权重 (161MB)
│ │ │ ├── optimizer.pt # 优化器状态 (321MB)
│ │ │ └── ...
│ │ └── adapter_config.json # LoRA 配置
│ │
│ └── buffett_lora/ # Buffett LoRA (500步训练)
│ ├── checkpoint-500/ # 最终检查点
│ │ ├── adapter_model.safetensors # LoRA 权重 (161MB)
│ │ └── ...
│ └── adapter_config.json
│
├── 📂 训练数据
│ ├── jre_conversational.jsonl # 40,291 条 JRE 对话数据 (57MB)
│ ├── jre_finetune.jsonl # 40,291 条 JRE 原始数据 (55MB)
│ ├── buffett_finetune.jsonl # 3,574 条 Buffett 数据 (5MB)
│ └── buffett_cnbc_interview.jsonl # 84 条 CNBC 采访数据 (78KB)
│
├── 📂 播客音频
│ ├── jre_podcast_1hr.mp3 # 30 分钟播客 Demo (15MB) ← 推荐使用
│ ├── jre_podcast_v2.mp3 # 5 分钟播客 Demo (2.3MB)
│ ├── jre_podcast_10min.mp3 # 旧版 Demo (2.1MB)
│ └── jre_podcast_demo.mp3 # 最早版 Demo (801KB)
│
├── 📂 训练脚本
│ ├── train_lora.py # Joe Rogan 训练脚本 (500步)
│ ├── train_buffett.py # Buffett 训练脚本 (500步)
│ ├── generate_podcast_v2.py # 5分钟播客生成脚本
│ ├── generate_1hr_podcast.py # 1小时播客生成脚本 (153段对话)
│ └── generate_remaining.py # 剩余片段生成脚本
│
├── 📂 参考音频
│ ├── JoeRoganAISample.mp3 # Joe Rogan 参考音频 (3.3MB) ← 推荐使用
│ └── buffett_ref_v2.wav # Buffett 参考音频 (8.3MB) ← 推荐使用
│
└── 📂 缓存(可删除)
├── cache/ # HuggingFace 和 TTS 模型缓存
├── podcast_1hr/ # 153 个中间 wav 文件
└── podcast_v2/ # 24 个中间 wav 文件
⚠️ 新机器开机后,运行以下脚本即可恢复完整环境:
bash /workspace/setup_env.sh
| 组件 | 版本/信息 |
|---|---|
| Python | 3.10.13 |
| PyTorch | 2.1.0+cu118 |
| CUDA | 11.8 (驱动支持) |
| GPU | NVIDIA GeForce RTX 3090 (24GB) |
| Transformers | 4.44.0 |
| PEFT | 0.13.0 |
| TTS | 0.22.0 |
| Datasets | 4.8.4 |
| Accelerate | 1.1.0 |
| BitsAndBytes | 0.43.3 |
| Triton | 2.1.0 |
| 磁盘 | 100GB /workspace |
如果新机器环境丢失,运行以下脚本自动安装:
bash /workspace/setup_env.sh
或手动执行:
# 1. 安装 PyTorch (CUDA 11.8)
pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
# 2. 安装训练依赖
pip install transformers==4.44.0 peft==0.13.0 datasets accelerate==1.1.0 bitsandbytes==0.43.3
# 3. 安装 TTS
pip install TTS==0.22.0
# 4. 验证
python3 -c "import torch; print(f'CUDA: {torch.cuda.is_available()}, GPU: {torch.cuda.get_device_name(0)}')"
python3 -c "from TTS.api import TTS; print('TTS OK')"
python3 -c "import torch; print(f'CUDA: {torch.cuda.is_available()}, GPU: {torch.cuda.get_device_name(0)}')"
python3 -c "from TTS.api import TTS; print('TTS OK')"
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# 加载基础模型
model_name = "unsloth/llama-3-8b-Instruct-bnb-4bit"
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype=torch.float16,
device_map="auto",
trust_remote_code=True,
)
# 加载 Joe Rogan LoRA
model = PeftModel.from_pretrained(model, "/workspace/joe_rogan_lora_v2/checkpoint-500")
model.eval()
# 生成对话
prompt = """System: You are Joe Rogan hosting The Joe Rogan Experience podcast. Speak naturally, casually, and with genuine curiosity.
User: What do you think about AI?
Assistant:"""
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.8, top_p=0.9, do_sample=True)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
from TTS.api import TTS
# 加载模型
tts = TTS(model_name='tts_models/multilingual/multi-dataset/xtts_v2')
tts.to('cuda')
# Joe Rogan 声音
tts.tts_to_file(
text="Welcome to the Joe Rogan Experience.",
speaker_wav="/workspace/JoeRoganAISample.mp3", # Joe 参考音频
language='en',
file_path="joe_output.wav",
)
# Buffett 声音
tts.tts_to_file(
text="The best investment you can make is in yourself.",
speaker_wav="/workspace/buffett_ref_v2.wav", # Buffett 参考音频
language='en',
file_path="buffett_output.wav",
)
# 5分钟播客
python /workspace/generate_podcast_v2.py
# 30分钟播客
python /workspace/generate_1hr_podcast.py
| 参数 | 值 |
|---|---|
| 基础模型 | unsloth/llama-3-8B-Instruct-bnb-4bit |
| 训练数据 | 40,291 条 JRE 对话 |
| 训练步数 | 500 |
| 学习率 | 2e-4 (线性衰减) |
| Batch Size | 1 (gradient accumulation=8) |
| LoRA r | 16 |
| LoRA alpha | 16 |
| 最终 Loss | ~2.94 |
| 模型大小 | 161MB |
| 参数 | 值 |
|---|---|
| 基础模型 | unsloth/llama-3-8B-Instruct-bnb-4bit |
| 训练数据 | 3,574 条致股东信 + 84 条 CNBC 采访 |
| 训练步数 | 500 |
| 学习率 | 2e-4 (线性衰减) |
| Batch Size | 1 (gradient accumulation=8) |
| LoRA r | 16 |
| LoRA alpha | 16 |
| 最终 Loss | ~1.06 |
| 模型大小 | 161MB |
# 修改 train_lora.py 或 train_buffett.py
# 将 max_steps=500 改为 max_steps=1000
# 从 checkpoint-500 恢复训练
from peft import PeftModel
model = PeftModel.from_pretrained(model, "/workspace/joe_rogan_lora_v2/checkpoint-500")
model.train()
trainer = Trainer(
model=model,
train_dataset=tokenized_dataset,
args=TrainingArguments(
...
max_steps=1000, # 继续训练 500 步
...
),
)
trainer.train(resume_from_checkpoint="/workspace/joe_rogan_lora_v2/checkpoint-500")
python /workspace/train_lora.py
{"messages": [
{"role": "system", "content": "You are Joe Rogan hosting The Joe Rogan Experience podcast."},
{"role": "user", "content": "Continue the conversation:\n\n[上下文]"},
{"role": "assistant", "content": "[Joe 的回答]"}
]}
# 清洗 JRE 数据
python /workspace/clean_jre_data.py
# 清洗 Buffett 数据
python /workspace/clean_buffett_data.py
# 转换为对话格式
python /workspace/clean_jre_conversational.py
/workspace 有足够空间/workspace/cache/ 和中间 wav 文件释放空间A: 减小 batch_size 或启用 gradient checkpointing:
args=TrainingArguments(
per_device_train_batch_size=1,
gradient_checkpointing=True,
...
)
A: 使用 test_model.py 生成样本对话,人工评估质量:
python /workspace/test_model.py
A: 尝试:
本项目仅供学习和研究使用。
最后更新:2026-04-05 项目状态:✅ 训练完成,模型可用