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