LTTEAM commited on
Commit
23f21ee
·
verified ·
1 Parent(s): cb53023

Upload TTS.ipynb

Browse files
Files changed (1) hide show
  1. TTS.ipynb +114 -0
TTS.ipynb ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {
6
+ "id": "AnNkJH3Z5m4G"
7
+ },
8
+ "source": [
9
+ "# Hướng Dẫn Sử Dụng Clone Giọng Đọc 🎤 - Phát triển bởi Lý Trần"
10
+ ]
11
+ },
12
+ {
13
+ "cell_type": "markdown",
14
+ "metadata": {
15
+ "id": "OOSUWWEw5H-t"
16
+ },
17
+ "source": [
18
+ "## 1. Cài đặt ứng dụng\n",
19
+ "\n",
20
+ "Chờ tải kho lưu trữ từ GitHub và cài đặt tất cả các gói cần thiết"
21
+ ]
22
+ },
23
+ {
24
+ "cell_type": "code",
25
+ "execution_count": null,
26
+ "metadata": {
27
+ "cellView": "form",
28
+ "id": "bO7B4GlvbY6n"
29
+ },
30
+ "outputs": [],
31
+ "source": [
32
+ "#@title ⚙️ Cài đặt\n",
33
+ "!git clone https://huggingface.co/spaces/LTTEAM/Clone\n",
34
+ "!pip install chatterbox-tts\n",
35
+ "!pip install edge_tts\n",
36
+ "!pip install gradio pydub scipy\n",
37
+ "!pip install webrtcvad\n",
38
+ "!apt install ffmpeg\n",
39
+ "!pip install pysrt\n",
40
+ "%cd /content/Clone/\n",
41
+ "file_path = \"app.py\"\n",
42
+ "\n",
43
+ "with open(file_path, \"r\", encoding=\"utf-8\") as f:\n",
44
+ " code = f.read()\n",
45
+ "\n",
46
+ "# Replace the line\n",
47
+ "updated_code = code.replace(\n",
48
+ " \"demo.queue().launch()\",\n",
49
+ " \"demo.queue().launch(share=True)\"\n",
50
+ ")\n",
51
+ "\n",
52
+ "with open(file_path, \"w\", encoding=\"utf-8\") as f:\n",
53
+ " f.write(updated_code)\n",
54
+ "\n",
55
+ "print(\"✅ Updated 'demo.queue().launch()' to include share=True\")"
56
+ ]
57
+ },
58
+ {
59
+ "cell_type": "markdown",
60
+ "metadata": {
61
+ "id": "k2j5fAeD5QOt"
62
+ },
63
+ "source": [
64
+ "## 2. Chạy ứng dụng\n",
65
+ "\n",
66
+ "Sau khi chạy ứng dụng sẽ có 1 liên kết để mở ứng dụng"
67
+ ]
68
+ },
69
+ {
70
+ "cell_type": "code",
71
+ "execution_count": 5,
72
+ "metadata": {
73
+ "cellView": "form",
74
+ "id": "NeApPz44dgPP"
75
+ },
76
+ "outputs": [],
77
+ "source": [
78
+ "#@title ⌛️ Chạy\n",
79
+ "%cd /content/Clone/\n",
80
+ "!python app.py"
81
+ ]
82
+ },
83
+ {
84
+ "cell_type": "markdown",
85
+ "source": [
86
+ "Mở `URL công khai` khi nó xuất hiện đuôi ***`.gradio.live`*** ( Vidu: https://9fca9044888a41a009.gradio.live )"
87
+ ],
88
+ "metadata": {
89
+ "id": "1ig9PCBRWbgg"
90
+ }
91
+ }
92
+ ],
93
+ "metadata": {
94
+ "accelerator": "GPU",
95
+ "colab": {
96
+ "gpuType": "T4",
97
+ "provenance": [],
98
+ "collapsed_sections": [
99
+ "AnNkJH3Z5m4G",
100
+ "OOSUWWEw5H-t",
101
+ "k2j5fAeD5QOt"
102
+ ]
103
+ },
104
+ "kernelspec": {
105
+ "display_name": "Python 3",
106
+ "name": "python3"
107
+ },
108
+ "language_info": {
109
+ "name": "python"
110
+ }
111
+ },
112
+ "nbformat": 4,
113
+ "nbformat_minor": 0
114
+ }