当前位置: 首页 > news >正文

whisperspeech 英文TTS的实现

以下代码成功运行在 colab 中,需要修改运行时类型为 T4 GPU

!pip install -Uqq WhisperSpeech
def is_colab():try: import google.colab; return Trueexcept: return Falseimport torch
# if not torch.cuda.is_available():
#     if is_colab(): raise BaseException("Please change the runtime type to GPU. In the menu: Runtime -> Change runtime type (the free T4 instance is enough)")
#     else:          raise BaseException("Currently the example notebook requires CUDA, make sure you are running this on a machine with a GPU.")# %load_ext autoreload
# %autoreload 2import torch
import torch.nn.functional as Ffrom IPython.display import Markdown, HTML# check "7. Pipeline.ipynb"
from whisperspeech.pipeline import Pipelinepipe = Pipeline(s2a_ref='collabora/whisperspeech:s2a-q4-tiny-en+pl.model')# pipe.generate_to_notebook("""
# This is the first demo of Whisper Speech, a fully open source text-to-speech model trained by Collabora and Lion on the Juwels supercomputer.
# """)pipe.generate_to_notebook("""
History will not look kindly on House Republicans for their blatant act of unconstitutional partisanship 
that has targeted an honorable public servant in order to play petty political games. Homeland Security Secretary Mayorkas, 
a Cuban immigrant who came to the United States with his family as political refugees, has spent more than two decades serving America 
with integrity in a decorated career in law enforcement and public service.
""")#也可以保存到文件:
# pipe.generate_to_file("output.wav", "This is the first demo of Whisper Speech, a fully open source text-to-speech model # trained by Collabora and Lion on the Juwels supercomputer")

相关文章:

  • Python学习之路-爬虫进阶:爬虫框架
  • 11.JavaScript 中如何进行隐式类型转换?
  • 2024年华为OD机试真题-计算面积-Python-OD统一考试(C卷)
  • C语言静态库深入剖析
  • Apache Kafka: 强大消息队列系统的介绍与使用
  • OpenGL-ES 学习(1)---- AlphaBlend
  • nodejs学习计划--(十)会话控制及https补充
  • mysql全国省市县三级联动创表sql(一)
  • STM32之定时器
  • BTC破5W+QAQ
  • Windows 平台下NDK/CMAKE编译自己程序命令行
  • HarmonyOS 鸿蒙 ArkTS ArkUI 页面之间切换转换动画设置
  • 基于微信小程序的校园失物招领小程序
  • ajax函数库axios基本使用
  • Go语言从基础到高级-目录
  • 【翻译】Mashape是如何管理15000个API和微服务的(三)
  • bootstrap创建登录注册页面
  • CAP理论的例子讲解
  • IOS评论框不贴底(ios12新bug)
  • JavaScript中的对象个人分享
  • LeetCode541. Reverse String II -- 按步长反转字符串
  • MySQL常见的两种存储引擎:MyISAM与InnoDB的爱恨情仇
  • Netty+SpringBoot+FastDFS+Html5实现聊天App(六)
  • Solarized Scheme
  • unity如何实现一个固定宽度的orthagraphic相机
  • 彻底搞懂浏览器Event-loop
  • 从 Android Sample ApiDemos 中学习 android.animation API 的用法
  • 从地狱到天堂,Node 回调向 async/await 转变
  • 从零开始的webpack生活-0x009:FilesLoader装载文件
  • 高性能JavaScript阅读简记(三)
  • 聚簇索引和非聚簇索引
  • 名企6年Java程序员的工作总结,写给在迷茫中的你!
  • 浅谈web中前端模板引擎的使用
  • 算法---两个栈实现一个队列
  • 微服务核心架构梳理
  • 微信小程序上拉加载:onReachBottom详解+设置触发距离
  • 学习笔记DL002:AI、机器学习、表示学习、深度学习,第一次大衰退
  • 鱼骨图 - 如何绘制?
  • 《码出高效》学习笔记与书中错误记录
  • 阿里云重庆大学大数据训练营落地分享
  • ​LeetCode解法汇总2304. 网格中的最小路径代价
  • # Swust 12th acm 邀请赛# [ A ] A+B problem [题解]
  • #FPGA(基础知识)
  • #Linux(帮助手册)
  • (4)(4.6) Triducer
  • (C语言)共用体union的用法举例
  • (day 12)JavaScript学习笔记(数组3)
  • (八)Flask之app.route装饰器函数的参数
  • (定时器/计数器)中断系统(详解与使用)
  • (分布式缓存)Redis分片集群
  • (机器学习的矩阵)(向量、矩阵与多元线性回归)
  • (教学思路 C#之类三)方法参数类型(ref、out、parmas)
  • (欧拉)openEuler系统添加网卡文件配置流程、(欧拉)openEuler系统手动配置ipv6地址流程、(欧拉)openEuler系统网络管理说明
  • (转)c++ std::pair 与 std::make
  • (转)Sublime Text3配置Lua运行环境