diff --git "a/abc/infer.ipynb" "b/abc/infer.ipynb"
deleted file mode 100644--- "a/abc/infer.ipynb"
+++ /dev/null
@@ -1,251 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 1,
- "metadata": {},
- "outputs": [],
- "source": [
- "import torch\n",
- "import ChatTTS\n",
- "from IPython.display import Audio"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "application/vnd.jupyter.widget-view+json": {
- "model_id": "d47abb2d74f4488685a4efb5da8fd791",
- "version_major": 2,
- "version_minor": 0
- },
- "text/plain": [
- "Fetching 10 files: 0%| | 0/10 [00:00, ?it/s]"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "INFO:ChatTTS.core:use cuda:0\n",
- "INFO:ChatTTS.core:vocos loaded.\n",
- "INFO:ChatTTS.core:dvae loaded.\n",
- "INFO:ChatTTS.core:gpt loaded.\n",
- "INFO:ChatTTS.core:decoder loaded.\n",
- "INFO:ChatTTS.core:tokenizer loaded.\n",
- "INFO:ChatTTS.core:All initialized.\n"
- ]
- }
- ],
- "source": [
- "chat = ChatTTS.Chat()\n",
- "chat.load_models()"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "metadata": {},
- "outputs": [],
- "source": [
- "texts = [\"So we found being competitive and collaborative was a huge way of staying motivated towards our goals, so one person to call when you fall off, one person who gets you back on then one person to actually do the activity with.\",]*3 \\\n",
- " + [\"我觉得像我们这些写程序的人,他,我觉得多多少少可能会对开源有一种情怀在吧我觉得开源是一个很好的形式。现在其实最先进的技术掌握在一些公司的手里的话,就他们并不会轻易的开放给所有的人用。\"]*3 "
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "INFO:ChatTTS.core:All initialized.\n",
- " 29%|██▉ | 112/384 [00:01<00:03, 69.90it/s]\n",
- " 48%|████▊ | 987/2048 [00:13<00:14, 70.89it/s]\n"
- ]
- }
- ],
- "source": [
- "wavs = chat.infer(texts, use_decoder=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 5,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- " \n",
- " "
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": null,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "Audio(wavs[0], rate=24_000, autoplay=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 6,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- " \n",
- " "
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": null,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "Audio(wavs[3], rate=24_000, autoplay=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 7,
- "metadata": {},
- "outputs": [],
- "source": [
- "from ChatTTS.experimental.llm import llm_api\n",
- "\n",
- "API_KEY = ''\n",
- "client = llm_api(api_key=API_KEY,\n",
- " base_url=\"https://api.deepseek.com\",\n",
- " model=\"deepseek-chat\")"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 8,
- "metadata": {},
- "outputs": [],
- "source": [
- "user_question = '四川有哪些好吃的美食呢?'\n",
- "text = client.call(user_question, prompt_version = 'deepseek')\n",
- "text = client.call(text, prompt_version = 'deepseek_TN')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 9,
- "metadata": {},
- "outputs": [],
- "source": [
- "spk_stat = torch.load('ChatTTS/asset/spk_stat.pt')\n",
- "rand_spk = torch.randn(768) * spk_stat.chunk(2)[0] + spk_stat.chunk(2)[1]"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 10,
- "metadata": {},
- "outputs": [
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "INFO:ChatTTS.core:All initialized.\n",
- " 16%|█▋ | 63/384 [00:00<00:04, 77.87it/s]\n",
- " 26%|██▌ | 530/2048 [00:06<00:19, 78.64it/s]\n"
- ]
- }
- ],
- "source": [
- "params_infer_code = {'spk_emb' : rand_spk, 'temperature':.3}\n",
- "params_refine_text = {'prompt':'[oral_2][laugh_0][break_6]'}\n",
- "# wav = chat.infer('四川美食可多了,有麻辣火锅、宫保鸡丁、麻婆豆腐、担担面、回锅肉、夫妻肺片等,每样都让人垂涎三尺。', params_refine_text=params_refine_text, params_infer_code=params_infer_code)\n",
- "wav = chat.infer('四川美食确实以辣闻名,但也有不辣的选择。比如甜水面、赖汤圆、蛋烘糕、叶儿粑等,这些小吃口味温和,甜而不腻,也很受欢迎。', params_refine_text=params_refine_text, params_infer_code=params_infer_code)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 11,
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/html": [
- "\n",
- " \n",
- " "
- ],
- "text/plain": [
- ""
- ]
- },
- "execution_count": null,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
- "source": [
- "Audio(wav[0], rate=24_000, autoplay=True)"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": null,
- "metadata": {},
- "outputs": [],
- "source": []
- }
- ],
- "metadata": {
- "kernelspec": {
- "display_name": "Python 3 (ipykernel)",
- "language": "python",
- "name": "python3"
- },
- "language_info": {
- "codemirror_mode": {
- "name": "ipython",
- "version": 3
- },
- "file_extension": ".py",
- "mimetype": "text/x-python",
- "name": "python",
- "nbconvert_exporter": "python",
- "pygments_lexer": "ipython3",
- "version": "3.10.8"
- }
- },
- "nbformat": 4,
- "nbformat_minor": 4
-}