moza2025 commited on
Commit
bfc6e6d
·
verified ·
1 Parent(s): 0911c20

Delete Copy_of_Chatbot_MozahAlismail_(1).ipynb

Browse files
Copy_of_Chatbot_MozahAlismail_(1).ipynb DELETED
@@ -1,725 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "source": [
6
- "!pip install transformers\n",
7
- "!pip install gradio\n",
8
- "!pip install torch"
9
- ],
10
- "metadata": {
11
- "colab": {
12
- "base_uri": "https://localhost:8080/",
13
- "height": 1000
14
- },
15
- "id": "4vnVDXIEMCIn",
16
- "outputId": "d9b5608e-80f5-4a89-cc3a-6c8520a1ae05"
17
- },
18
- "id": "4vnVDXIEMCIn",
19
- "execution_count": null,
20
- "outputs": [
21
- {
22
- "output_type": "stream",
23
- "name": "stdout",
24
- "text": [
25
- "Requirement already satisfied: transformers in /usr/local/lib/python3.11/dist-packages (4.52.4)\n",
26
- "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from transformers) (3.18.0)\n",
27
- "Requirement already satisfied: huggingface-hub<1.0,>=0.30.0 in /usr/local/lib/python3.11/dist-packages (from transformers) (0.33.0)\n",
28
- "Requirement already satisfied: numpy>=1.17 in /usr/local/lib/python3.11/dist-packages (from transformers) (2.0.2)\n",
29
- "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/dist-packages (from transformers) (24.2)\n",
30
- "Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from transformers) (6.0.2)\n",
31
- "Requirement already satisfied: regex!=2019.12.17 in /usr/local/lib/python3.11/dist-packages (from transformers) (2024.11.6)\n",
32
- "Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from transformers) (2.32.3)\n",
33
- "Requirement already satisfied: tokenizers<0.22,>=0.21 in /usr/local/lib/python3.11/dist-packages (from transformers) (0.21.2)\n",
34
- "Requirement already satisfied: safetensors>=0.4.3 in /usr/local/lib/python3.11/dist-packages (from transformers) (0.5.3)\n",
35
- "Requirement already satisfied: tqdm>=4.27 in /usr/local/lib/python3.11/dist-packages (from transformers) (4.67.1)\n",
36
- "Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub<1.0,>=0.30.0->transformers) (2025.3.2)\n",
37
- "Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub<1.0,>=0.30.0->transformers) (4.14.0)\n",
38
- "Requirement already satisfied: hf-xet<2.0.0,>=1.1.2 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub<1.0,>=0.30.0->transformers) (1.1.5)\n",
39
- "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->transformers) (3.4.2)\n",
40
- "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests->transformers) (3.10)\n",
41
- "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests->transformers) (2.4.0)\n",
42
- "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests->transformers) (2025.6.15)\n",
43
- "Requirement already satisfied: gradio in /usr/local/lib/python3.11/dist-packages (5.31.0)\n",
44
- "Requirement already satisfied: aiofiles<25.0,>=22.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (24.1.0)\n",
45
- "Requirement already satisfied: anyio<5.0,>=3.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (4.9.0)\n",
46
- "Requirement already satisfied: fastapi<1.0,>=0.115.2 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.115.13)\n",
47
- "Requirement already satisfied: ffmpy in /usr/local/lib/python3.11/dist-packages (from gradio) (0.6.0)\n",
48
- "Requirement already satisfied: gradio-client==1.10.1 in /usr/local/lib/python3.11/dist-packages (from gradio) (1.10.1)\n",
49
- "Requirement already satisfied: groovy~=0.1 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.1.2)\n",
50
- "Requirement already satisfied: httpx>=0.24.1 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.28.1)\n",
51
- "Requirement already satisfied: huggingface-hub>=0.28.1 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.33.0)\n",
52
- "Requirement already satisfied: jinja2<4.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (3.1.6)\n",
53
- "Requirement already satisfied: markupsafe<4.0,>=2.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (3.0.2)\n",
54
- "Requirement already satisfied: numpy<3.0,>=1.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (2.0.2)\n",
55
- "Requirement already satisfied: orjson~=3.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (3.10.18)\n",
56
- "Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from gradio) (24.2)\n",
57
- "Requirement already satisfied: pandas<3.0,>=1.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (2.2.2)\n",
58
- "Requirement already satisfied: pillow<12.0,>=8.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (11.2.1)\n",
59
- "Requirement already satisfied: pydantic<2.12,>=2.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (2.11.7)\n",
60
- "Requirement already satisfied: pydub in /usr/local/lib/python3.11/dist-packages (from gradio) (0.25.1)\n",
61
- "Requirement already satisfied: python-multipart>=0.0.18 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.0.20)\n",
62
- "Requirement already satisfied: pyyaml<7.0,>=5.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (6.0.2)\n",
63
- "Requirement already satisfied: ruff>=0.9.3 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.12.0)\n",
64
- "Requirement already satisfied: safehttpx<0.2.0,>=0.1.6 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.1.6)\n",
65
- "Requirement already satisfied: semantic-version~=2.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (2.10.0)\n",
66
- "Requirement already satisfied: starlette<1.0,>=0.40.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.46.2)\n",
67
- "Requirement already satisfied: tomlkit<0.14.0,>=0.12.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.13.3)\n",
68
- "Requirement already satisfied: typer<1.0,>=0.12 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.16.0)\n",
69
- "Requirement already satisfied: typing-extensions~=4.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (4.14.0)\n",
70
- "Requirement already satisfied: uvicorn>=0.14.0 in /usr/local/lib/python3.11/dist-packages (from gradio) (0.34.3)\n",
71
- "Requirement already satisfied: fsspec in /usr/local/lib/python3.11/dist-packages (from gradio-client==1.10.1->gradio) (2025.3.2)\n",
72
- "Requirement already satisfied: websockets<16.0,>=10.0 in /usr/local/lib/python3.11/dist-packages (from gradio-client==1.10.1->gradio) (15.0.1)\n",
73
- "Requirement already satisfied: idna>=2.8 in /usr/local/lib/python3.11/dist-packages (from anyio<5.0,>=3.0->gradio) (3.10)\n",
74
- "Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.11/dist-packages (from anyio<5.0,>=3.0->gradio) (1.3.1)\n",
75
- "Requirement already satisfied: certifi in /usr/local/lib/python3.11/dist-packages (from httpx>=0.24.1->gradio) (2025.6.15)\n",
76
- "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/dist-packages (from httpx>=0.24.1->gradio) (1.0.9)\n",
77
- "Requirement already satisfied: h11>=0.16 in /usr/local/lib/python3.11/dist-packages (from httpcore==1.*->httpx>=0.24.1->gradio) (0.16.0)\n",
78
- "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.1->gradio) (3.18.0)\n",
79
- "Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.1->gradio) (2.32.3)\n",
80
- "Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.1->gradio) (4.67.1)\n",
81
- "Requirement already satisfied: hf-xet<2.0.0,>=1.1.2 in /usr/local/lib/python3.11/dist-packages (from huggingface-hub>=0.28.1->gradio) (1.1.5)\n",
82
- "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from pandas<3.0,>=1.0->gradio) (2.9.0.post0)\n",
83
- "Requirement already satisfied: pytz>=2020.1 in /usr/local/lib/python3.11/dist-packages (from pandas<3.0,>=1.0->gradio) (2025.2)\n",
84
- "Requirement already satisfied: tzdata>=2022.7 in /usr/local/lib/python3.11/dist-packages (from pandas<3.0,>=1.0->gradio) (2025.2)\n",
85
- "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.11/dist-packages (from pydantic<2.12,>=2.0->gradio) (0.7.0)\n",
86
- "Requirement already satisfied: pydantic-core==2.33.2 in /usr/local/lib/python3.11/dist-packages (from pydantic<2.12,>=2.0->gradio) (2.33.2)\n",
87
- "Requirement already satisfied: typing-inspection>=0.4.0 in /usr/local/lib/python3.11/dist-packages (from pydantic<2.12,>=2.0->gradio) (0.4.1)\n",
88
- "Requirement already satisfied: click>=8.0.0 in /usr/local/lib/python3.11/dist-packages (from typer<1.0,>=0.12->gradio) (8.2.1)\n",
89
- "Requirement already satisfied: shellingham>=1.3.0 in /usr/local/lib/python3.11/dist-packages (from typer<1.0,>=0.12->gradio) (1.5.4)\n",
90
- "Requirement already satisfied: rich>=10.11.0 in /usr/local/lib/python3.11/dist-packages (from typer<1.0,>=0.12->gradio) (13.9.4)\n",
91
- "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->pandas<3.0,>=1.0->gradio) (1.17.0)\n",
92
- "Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.11/dist-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (3.0.0)\n",
93
- "Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.11/dist-packages (from rich>=10.11.0->typer<1.0,>=0.12->gradio) (2.19.2)\n",
94
- "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface-hub>=0.28.1->gradio) (3.4.2)\n",
95
- "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface-hub>=0.28.1->gradio) (2.4.0)\n",
96
- "Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.11/dist-packages (from markdown-it-py>=2.2.0->rich>=10.11.0->typer<1.0,>=0.12->gradio) (0.1.2)\n",
97
- "Requirement already satisfied: torch in /usr/local/lib/python3.11/dist-packages (2.6.0+cu124)\n",
98
- "Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from torch) (3.18.0)\n",
99
- "Requirement already satisfied: typing-extensions>=4.10.0 in /usr/local/lib/python3.11/dist-packages (from torch) (4.14.0)\n",
100
- "Requirement already satisfied: networkx in /usr/local/lib/python3.11/dist-packages (from torch) (3.5)\n",
101
- "Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/dist-packages (from torch) (3.1.6)\n",
102
- "Requirement already satisfied: fsspec in /usr/local/lib/python3.11/dist-packages (from torch) (2025.3.2)\n",
103
- "Collecting nvidia-cuda-nvrtc-cu12==12.4.127 (from torch)\n",
104
- " Downloading nvidia_cuda_nvrtc_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
105
- "Collecting nvidia-cuda-runtime-cu12==12.4.127 (from torch)\n",
106
- " Downloading nvidia_cuda_runtime_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
107
- "Collecting nvidia-cuda-cupti-cu12==12.4.127 (from torch)\n",
108
- " Downloading nvidia_cuda_cupti_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
109
- "Collecting nvidia-cudnn-cu12==9.1.0.70 (from torch)\n",
110
- " Downloading nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
111
- "Collecting nvidia-cublas-cu12==12.4.5.8 (from torch)\n",
112
- " Downloading nvidia_cublas_cu12-12.4.5.8-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
113
- "Collecting nvidia-cufft-cu12==11.2.1.3 (from torch)\n",
114
- " Downloading nvidia_cufft_cu12-11.2.1.3-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
115
- "Collecting nvidia-curand-cu12==10.3.5.147 (from torch)\n",
116
- " Downloading nvidia_curand_cu12-10.3.5.147-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
117
- "Collecting nvidia-cusolver-cu12==11.6.1.9 (from torch)\n",
118
- " Downloading nvidia_cusolver_cu12-11.6.1.9-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
119
- "Collecting nvidia-cusparse-cu12==12.3.1.170 (from torch)\n",
120
- " Downloading nvidia_cusparse_cu12-12.3.1.170-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
121
- "Requirement already satisfied: nvidia-cusparselt-cu12==0.6.2 in /usr/local/lib/python3.11/dist-packages (from torch) (0.6.2)\n",
122
- "Requirement already satisfied: nvidia-nccl-cu12==2.21.5 in /usr/local/lib/python3.11/dist-packages (from torch) (2.21.5)\n",
123
- "Requirement already satisfied: nvidia-nvtx-cu12==12.4.127 in /usr/local/lib/python3.11/dist-packages (from torch) (12.4.127)\n",
124
- "Collecting nvidia-nvjitlink-cu12==12.4.127 (from torch)\n",
125
- " Downloading nvidia_nvjitlink_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
126
- "Requirement already satisfied: triton==3.2.0 in /usr/local/lib/python3.11/dist-packages (from torch) (3.2.0)\n",
127
- "Requirement already satisfied: sympy==1.13.1 in /usr/local/lib/python3.11/dist-packages (from torch) (1.13.1)\n",
128
- "Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from sympy==1.13.1->torch) (1.3.0)\n",
129
- "Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2->torch) (3.0.2)\n",
130
- "Downloading nvidia_cublas_cu12-12.4.5.8-py3-none-manylinux2014_x86_64.whl (363.4 MB)\n",
131
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m363.4/363.4 MB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
132
- "\u001b[?25hDownloading nvidia_cuda_cupti_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (13.8 MB)\n",
133
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.8/13.8 MB\u001b[0m \u001b[31m126.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
134
- "\u001b[?25hDownloading nvidia_cuda_nvrtc_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (24.6 MB)\n",
135
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m24.6/24.6 MB\u001b[0m \u001b[31m26.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
136
- "\u001b[?25hDownloading nvidia_cuda_runtime_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (883 kB)\n",
137
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m883.7/883.7 kB\u001b[0m \u001b[31m61.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
138
- "\u001b[?25hDownloading nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl (664.8 MB)\n",
139
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m664.8/664.8 MB\u001b[0m \u001b[31m2.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
140
- "\u001b[?25hDownloading nvidia_cufft_cu12-11.2.1.3-py3-none-manylinux2014_x86_64.whl (211.5 MB)\n",
141
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m211.5/211.5 MB\u001b[0m \u001b[31m9.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
142
- "\u001b[?25hDownloading nvidia_curand_cu12-10.3.5.147-py3-none-manylinux2014_x86_64.whl (56.3 MB)\n",
143
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.3/56.3 MB\u001b[0m \u001b[31m14.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
144
- "\u001b[?25hDownloading nvidia_cusolver_cu12-11.6.1.9-py3-none-manylinux2014_x86_64.whl (127.9 MB)\n",
145
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m127.9/127.9 MB\u001b[0m \u001b[31m8.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
146
- "\u001b[?25hDownloading nvidia_cusparse_cu12-12.3.1.170-py3-none-manylinux2014_x86_64.whl (207.5 MB)\n",
147
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m207.5/207.5 MB\u001b[0m \u001b[31m6.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
148
- "\u001b[?25hDownloading nvidia_nvjitlink_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (21.1 MB)\n",
149
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m21.1/21.1 MB\u001b[0m \u001b[31m106.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
150
- "\u001b[?25hInstalling collected packages: nvidia-nvjitlink-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, nvidia-cusparse-cu12, nvidia-cudnn-cu12, nvidia-cusolver-cu12\n",
151
- " Attempting uninstall: nvidia-nvjitlink-cu12\n",
152
- " Found existing installation: nvidia-nvjitlink-cu12 12.5.82\n",
153
- " Uninstalling nvidia-nvjitlink-cu12-12.5.82:\n",
154
- " Successfully uninstalled nvidia-nvjitlink-cu12-12.5.82\n",
155
- " Attempting uninstall: nvidia-curand-cu12\n",
156
- " Found existing installation: nvidia-curand-cu12 10.3.6.82\n",
157
- " Uninstalling nvidia-curand-cu12-10.3.6.82:\n",
158
- " Successfully uninstalled nvidia-curand-cu12-10.3.6.82\n",
159
- " Attempting uninstall: nvidia-cufft-cu12\n",
160
- " Found existing installation: nvidia-cufft-cu12 11.2.3.61\n",
161
- " Uninstalling nvidia-cufft-cu12-11.2.3.61:\n",
162
- " Successfully uninstalled nvidia-cufft-cu12-11.2.3.61\n",
163
- " Attempting uninstall: nvidia-cuda-runtime-cu12\n",
164
- " Found existing installation: nvidia-cuda-runtime-cu12 12.5.82\n",
165
- " Uninstalling nvidia-cuda-runtime-cu12-12.5.82:\n",
166
- " Successfully uninstalled nvidia-cuda-runtime-cu12-12.5.82\n",
167
- " Attempting uninstall: nvidia-cuda-nvrtc-cu12\n",
168
- " Found existing installation: nvidia-cuda-nvrtc-cu12 12.5.82\n",
169
- " Uninstalling nvidia-cuda-nvrtc-cu12-12.5.82:\n",
170
- " Successfully uninstalled nvidia-cuda-nvrtc-cu12-12.5.82\n",
171
- " Attempting uninstall: nvidia-cuda-cupti-cu12\n",
172
- " Found existing installation: nvidia-cuda-cupti-cu12 12.5.82\n",
173
- " Uninstalling nvidia-cuda-cupti-cu12-12.5.82:\n",
174
- " Successfully uninstalled nvidia-cuda-cupti-cu12-12.5.82\n",
175
- " Attempting uninstall: nvidia-cublas-cu12\n",
176
- " Found existing installation: nvidia-cublas-cu12 12.5.3.2\n",
177
- " Uninstalling nvidia-cublas-cu12-12.5.3.2:\n",
178
- " Successfully uninstalled nvidia-cublas-cu12-12.5.3.2\n",
179
- " Attempting uninstall: nvidia-cusparse-cu12\n",
180
- " Found existing installation: nvidia-cusparse-cu12 12.5.1.3\n",
181
- " Uninstalling nvidia-cusparse-cu12-12.5.1.3:\n",
182
- " Successfully uninstalled nvidia-cusparse-cu12-12.5.1.3\n",
183
- " Attempting uninstall: nvidia-cudnn-cu12\n",
184
- " Found existing installation: nvidia-cudnn-cu12 9.3.0.75\n",
185
- " Uninstalling nvidia-cudnn-cu12-9.3.0.75:\n",
186
- " Successfully uninstalled nvidia-cudnn-cu12-9.3.0.75\n",
187
- " Attempting uninstall: nvidia-cusolver-cu12\n",
188
- " Found existing installation: nvidia-cusolver-cu12 11.6.3.83\n",
189
- " Uninstalling nvidia-cusolver-cu12-11.6.3.83:\n",
190
- " Successfully uninstalled nvidia-cusolver-cu12-11.6.3.83\n",
191
- "Successfully installed nvidia-cublas-cu12-12.4.5.8 nvidia-cuda-cupti-cu12-12.4.127 nvidia-cuda-nvrtc-cu12-12.4.127 nvidia-cuda-runtime-cu12-12.4.127 nvidia-cudnn-cu12-9.1.0.70 nvidia-cufft-cu12-11.2.1.3 nvidia-curand-cu12-10.3.5.147 nvidia-cusolver-cu12-11.6.1.9 nvidia-cusparse-cu12-12.3.1.170 nvidia-nvjitlink-cu12-12.4.127\n"
192
- ]
193
- },
194
- {
195
- "output_type": "display_data",
196
- "data": {
197
- "application/vnd.colab-display-data+json": {
198
- "pip_warning": {
199
- "packages": [
200
- "nvidia"
201
- ]
202
- },
203
- "id": "fbc752c7cf6a4953a6e34f8f3cf6854e"
204
- }
205
- },
206
- "metadata": {}
207
- }
208
- ]
209
- },
210
- {
211
- "cell_type": "code",
212
- "source": [
213
- "import gradio as gr\n",
214
- "from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer"
215
- ],
216
- "metadata": {
217
- "id": "7bmdaC_jN_cQ"
218
- },
219
- "id": "7bmdaC_jN_cQ",
220
- "execution_count": null,
221
- "outputs": []
222
- },
223
- {
224
- "cell_type": "code",
225
- "execution_count": null,
226
- "id": "5d998fdc",
227
- "metadata": {
228
- "colab": {
229
- "base_uri": "https://localhost:8080/",
230
- "height": 67,
231
- "referenced_widgets": [
232
- "38763f4aee8e451a818a83cb45debf65",
233
- "2fb87d01c6794a51a387614205d73eb6",
234
- "095e3d4249044404ad44dd513bc3e660",
235
- "28a75ec02064405a980a8e03f18aafb6",
236
- "f63d66c1271c4d09a90fdf59c6d889df",
237
- "8abf6024f8764f2eba2ba893cb3b1ba6",
238
- "84f7b111dfb5405f94e6aceba2d1a671",
239
- "c0f397becb834224955ba5d18f11ce61",
240
- "aea3652694794b579350424888e6f14e",
241
- "a884853f211f40f582369c8d22c3daca",
242
- "3e4127ca08d3428a89f7041bec264f8a"
243
- ]
244
- },
245
- "id": "5d998fdc",
246
- "outputId": "be17dce4-a90d-407e-860b-f52bdb7cfd50"
247
- },
248
- "outputs": [
249
- {
250
- "output_type": "display_data",
251
- "data": {
252
- "text/plain": [
253
- "Loading checkpoint shards: 0%| | 0/2 [00:00<?, ?it/s]"
254
- ],
255
- "application/vnd.jupyter.widget-view+json": {
256
- "version_major": 2,
257
- "version_minor": 0,
258
- "model_id": "38763f4aee8e451a818a83cb45debf65"
259
- }
260
- },
261
- "metadata": {}
262
- },
263
- {
264
- "output_type": "stream",
265
- "name": "stderr",
266
- "text": [
267
- "Device set to use cuda:0\n"
268
- ]
269
- }
270
- ],
271
- "source": [
272
- "chat_pipeline = pipeline(\"text-generation\", model=\"yasserrmd/Human-Like-Qwen2.5-1.5B-Instruct\")"
273
- ]
274
- },
275
- {
276
- "cell_type": "code",
277
- "execution_count": null,
278
- "id": "55e0cf66",
279
- "metadata": {
280
- "id": "55e0cf66"
281
- },
282
- "outputs": [],
283
- "source": [
284
- "# === Chatbot ===\n",
285
- "def chatbot(message, chat_history):\n",
286
- " # Generate response\n",
287
- " result = chat_pipeline(message, max_new_tokens=10)\n",
288
- "\n",
289
- " # Extract only the reply\n",
290
- " bot_reply = result[0][\"generated_text\"]\n",
291
- "\n",
292
- " return bot_reply"
293
- ]
294
- },
295
- {
296
- "cell_type": "code",
297
- "execution_count": null,
298
- "id": "a03c31ef",
299
- "metadata": {
300
- "id": "a03c31ef"
301
- },
302
- "outputs": [],
303
- "source": [
304
- "demo = gr.ChatInterface(\n",
305
- " chatbot,\n",
306
- " type=\"messages\",\n",
307
- " title=\"Chatbot\",\n",
308
- " description=\"Start the conversation by sending text messages or ask questions!\",\n",
309
- ")"
310
- ]
311
- },
312
- {
313
- "cell_type": "code",
314
- "source": [
315
- "demo.launch()"
316
- ],
317
- "metadata": {
318
- "colab": {
319
- "base_uri": "https://localhost:8080/",
320
- "height": 650
321
- },
322
- "id": "8O-5UkYgXI8F",
323
- "outputId": "ca6bc130-9e25-400f-e8ed-2b1a4805dff0"
324
- },
325
- "id": "8O-5UkYgXI8F",
326
- "execution_count": null,
327
- "outputs": [
328
- {
329
- "output_type": "stream",
330
- "name": "stdout",
331
- "text": [
332
- "It looks like you are running Gradio on a hosted a Jupyter notebook. For the Gradio app to work, sharing must be enabled. Automatically setting `share=True` (you can turn this off by setting `share=False` in `launch()` explicitly).\n",
333
- "\n",
334
- "Colab notebook detected. To show errors in colab notebook, set debug=True in launch()\n",
335
- "* Running on public URL: https://9fddb00b0b590a0f85.gradio.live\n",
336
- "\n",
337
- "This share link expires in 1 week. For free permanent hosting and GPU upgrades, run `gradio deploy` from the terminal in the working directory to deploy to Hugging Face Spaces (https://huggingface.co/spaces)\n"
338
- ]
339
- },
340
- {
341
- "output_type": "display_data",
342
- "data": {
343
- "text/plain": [
344
- "<IPython.core.display.HTML object>"
345
- ],
346
- "text/html": [
347
- "<div><iframe src=\"https://9fddb00b0b590a0f85.gradio.live\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
348
- ]
349
- },
350
- "metadata": {}
351
- },
352
- {
353
- "output_type": "execute_result",
354
- "data": {
355
- "text/plain": []
356
- },
357
- "metadata": {},
358
- "execution_count": 5
359
- }
360
- ]
361
- }
362
- ],
363
- "metadata": {
364
- "language_info": {
365
- "name": "python"
366
- },
367
- "colab": {
368
- "provenance": [],
369
- "gpuType": "T4"
370
- },
371
- "kernelspec": {
372
- "name": "python3",
373
- "display_name": "Python 3"
374
- },
375
- "widgets": {
376
- "application/vnd.jupyter.widget-state+json": {
377
- "38763f4aee8e451a818a83cb45debf65": {
378
- "model_module": "@jupyter-widgets/controls",
379
- "model_name": "HBoxModel",
380
- "model_module_version": "1.5.0",
381
- "state": {
382
- "_dom_classes": [],
383
- "_model_module": "@jupyter-widgets/controls",
384
- "_model_module_version": "1.5.0",
385
- "_model_name": "HBoxModel",
386
- "_view_count": null,
387
- "_view_module": "@jupyter-widgets/controls",
388
- "_view_module_version": "1.5.0",
389
- "_view_name": "HBoxView",
390
- "box_style": "",
391
- "children": [
392
- "IPY_MODEL_2fb87d01c6794a51a387614205d73eb6",
393
- "IPY_MODEL_095e3d4249044404ad44dd513bc3e660",
394
- "IPY_MODEL_28a75ec02064405a980a8e03f18aafb6"
395
- ],
396
- "layout": "IPY_MODEL_f63d66c1271c4d09a90fdf59c6d889df"
397
- }
398
- },
399
- "2fb87d01c6794a51a387614205d73eb6": {
400
- "model_module": "@jupyter-widgets/controls",
401
- "model_name": "HTMLModel",
402
- "model_module_version": "1.5.0",
403
- "state": {
404
- "_dom_classes": [],
405
- "_model_module": "@jupyter-widgets/controls",
406
- "_model_module_version": "1.5.0",
407
- "_model_name": "HTMLModel",
408
- "_view_count": null,
409
- "_view_module": "@jupyter-widgets/controls",
410
- "_view_module_version": "1.5.0",
411
- "_view_name": "HTMLView",
412
- "description": "",
413
- "description_tooltip": null,
414
- "layout": "IPY_MODEL_8abf6024f8764f2eba2ba893cb3b1ba6",
415
- "placeholder": "​",
416
- "style": "IPY_MODEL_84f7b111dfb5405f94e6aceba2d1a671",
417
- "value": "Loading checkpoint shards: 100%"
418
- }
419
- },
420
- "095e3d4249044404ad44dd513bc3e660": {
421
- "model_module": "@jupyter-widgets/controls",
422
- "model_name": "FloatProgressModel",
423
- "model_module_version": "1.5.0",
424
- "state": {
425
- "_dom_classes": [],
426
- "_model_module": "@jupyter-widgets/controls",
427
- "_model_module_version": "1.5.0",
428
- "_model_name": "FloatProgressModel",
429
- "_view_count": null,
430
- "_view_module": "@jupyter-widgets/controls",
431
- "_view_module_version": "1.5.0",
432
- "_view_name": "ProgressView",
433
- "bar_style": "success",
434
- "description": "",
435
- "description_tooltip": null,
436
- "layout": "IPY_MODEL_c0f397becb834224955ba5d18f11ce61",
437
- "max": 2,
438
- "min": 0,
439
- "orientation": "horizontal",
440
- "style": "IPY_MODEL_aea3652694794b579350424888e6f14e",
441
- "value": 2
442
- }
443
- },
444
- "28a75ec02064405a980a8e03f18aafb6": {
445
- "model_module": "@jupyter-widgets/controls",
446
- "model_name": "HTMLModel",
447
- "model_module_version": "1.5.0",
448
- "state": {
449
- "_dom_classes": [],
450
- "_model_module": "@jupyter-widgets/controls",
451
- "_model_module_version": "1.5.0",
452
- "_model_name": "HTMLModel",
453
- "_view_count": null,
454
- "_view_module": "@jupyter-widgets/controls",
455
- "_view_module_version": "1.5.0",
456
- "_view_name": "HTMLView",
457
- "description": "",
458
- "description_tooltip": null,
459
- "layout": "IPY_MODEL_a884853f211f40f582369c8d22c3daca",
460
- "placeholder": "​",
461
- "style": "IPY_MODEL_3e4127ca08d3428a89f7041bec264f8a",
462
- "value": " 2/2 [00:00&lt;00:00,  4.79it/s]"
463
- }
464
- },
465
- "f63d66c1271c4d09a90fdf59c6d889df": {
466
- "model_module": "@jupyter-widgets/base",
467
- "model_name": "LayoutModel",
468
- "model_module_version": "1.2.0",
469
- "state": {
470
- "_model_module": "@jupyter-widgets/base",
471
- "_model_module_version": "1.2.0",
472
- "_model_name": "LayoutModel",
473
- "_view_count": null,
474
- "_view_module": "@jupyter-widgets/base",
475
- "_view_module_version": "1.2.0",
476
- "_view_name": "LayoutView",
477
- "align_content": null,
478
- "align_items": null,
479
- "align_self": null,
480
- "border": null,
481
- "bottom": null,
482
- "display": null,
483
- "flex": null,
484
- "flex_flow": null,
485
- "grid_area": null,
486
- "grid_auto_columns": null,
487
- "grid_auto_flow": null,
488
- "grid_auto_rows": null,
489
- "grid_column": null,
490
- "grid_gap": null,
491
- "grid_row": null,
492
- "grid_template_areas": null,
493
- "grid_template_columns": null,
494
- "grid_template_rows": null,
495
- "height": null,
496
- "justify_content": null,
497
- "justify_items": null,
498
- "left": null,
499
- "margin": null,
500
- "max_height": null,
501
- "max_width": null,
502
- "min_height": null,
503
- "min_width": null,
504
- "object_fit": null,
505
- "object_position": null,
506
- "order": null,
507
- "overflow": null,
508
- "overflow_x": null,
509
- "overflow_y": null,
510
- "padding": null,
511
- "right": null,
512
- "top": null,
513
- "visibility": null,
514
- "width": null
515
- }
516
- },
517
- "8abf6024f8764f2eba2ba893cb3b1ba6": {
518
- "model_module": "@jupyter-widgets/base",
519
- "model_name": "LayoutModel",
520
- "model_module_version": "1.2.0",
521
- "state": {
522
- "_model_module": "@jupyter-widgets/base",
523
- "_model_module_version": "1.2.0",
524
- "_model_name": "LayoutModel",
525
- "_view_count": null,
526
- "_view_module": "@jupyter-widgets/base",
527
- "_view_module_version": "1.2.0",
528
- "_view_name": "LayoutView",
529
- "align_content": null,
530
- "align_items": null,
531
- "align_self": null,
532
- "border": null,
533
- "bottom": null,
534
- "display": null,
535
- "flex": null,
536
- "flex_flow": null,
537
- "grid_area": null,
538
- "grid_auto_columns": null,
539
- "grid_auto_flow": null,
540
- "grid_auto_rows": null,
541
- "grid_column": null,
542
- "grid_gap": null,
543
- "grid_row": null,
544
- "grid_template_areas": null,
545
- "grid_template_columns": null,
546
- "grid_template_rows": null,
547
- "height": null,
548
- "justify_content": null,
549
- "justify_items": null,
550
- "left": null,
551
- "margin": null,
552
- "max_height": null,
553
- "max_width": null,
554
- "min_height": null,
555
- "min_width": null,
556
- "object_fit": null,
557
- "object_position": null,
558
- "order": null,
559
- "overflow": null,
560
- "overflow_x": null,
561
- "overflow_y": null,
562
- "padding": null,
563
- "right": null,
564
- "top": null,
565
- "visibility": null,
566
- "width": null
567
- }
568
- },
569
- "84f7b111dfb5405f94e6aceba2d1a671": {
570
- "model_module": "@jupyter-widgets/controls",
571
- "model_name": "DescriptionStyleModel",
572
- "model_module_version": "1.5.0",
573
- "state": {
574
- "_model_module": "@jupyter-widgets/controls",
575
- "_model_module_version": "1.5.0",
576
- "_model_name": "DescriptionStyleModel",
577
- "_view_count": null,
578
- "_view_module": "@jupyter-widgets/base",
579
- "_view_module_version": "1.2.0",
580
- "_view_name": "StyleView",
581
- "description_width": ""
582
- }
583
- },
584
- "c0f397becb834224955ba5d18f11ce61": {
585
- "model_module": "@jupyter-widgets/base",
586
- "model_name": "LayoutModel",
587
- "model_module_version": "1.2.0",
588
- "state": {
589
- "_model_module": "@jupyter-widgets/base",
590
- "_model_module_version": "1.2.0",
591
- "_model_name": "LayoutModel",
592
- "_view_count": null,
593
- "_view_module": "@jupyter-widgets/base",
594
- "_view_module_version": "1.2.0",
595
- "_view_name": "LayoutView",
596
- "align_content": null,
597
- "align_items": null,
598
- "align_self": null,
599
- "border": null,
600
- "bottom": null,
601
- "display": null,
602
- "flex": null,
603
- "flex_flow": null,
604
- "grid_area": null,
605
- "grid_auto_columns": null,
606
- "grid_auto_flow": null,
607
- "grid_auto_rows": null,
608
- "grid_column": null,
609
- "grid_gap": null,
610
- "grid_row": null,
611
- "grid_template_areas": null,
612
- "grid_template_columns": null,
613
- "grid_template_rows": null,
614
- "height": null,
615
- "justify_content": null,
616
- "justify_items": null,
617
- "left": null,
618
- "margin": null,
619
- "max_height": null,
620
- "max_width": null,
621
- "min_height": null,
622
- "min_width": null,
623
- "object_fit": null,
624
- "object_position": null,
625
- "order": null,
626
- "overflow": null,
627
- "overflow_x": null,
628
- "overflow_y": null,
629
- "padding": null,
630
- "right": null,
631
- "top": null,
632
- "visibility": null,
633
- "width": null
634
- }
635
- },
636
- "aea3652694794b579350424888e6f14e": {
637
- "model_module": "@jupyter-widgets/controls",
638
- "model_name": "ProgressStyleModel",
639
- "model_module_version": "1.5.0",
640
- "state": {
641
- "_model_module": "@jupyter-widgets/controls",
642
- "_model_module_version": "1.5.0",
643
- "_model_name": "ProgressStyleModel",
644
- "_view_count": null,
645
- "_view_module": "@jupyter-widgets/base",
646
- "_view_module_version": "1.2.0",
647
- "_view_name": "StyleView",
648
- "bar_color": null,
649
- "description_width": ""
650
- }
651
- },
652
- "a884853f211f40f582369c8d22c3daca": {
653
- "model_module": "@jupyter-widgets/base",
654
- "model_name": "LayoutModel",
655
- "model_module_version": "1.2.0",
656
- "state": {
657
- "_model_module": "@jupyter-widgets/base",
658
- "_model_module_version": "1.2.0",
659
- "_model_name": "LayoutModel",
660
- "_view_count": null,
661
- "_view_module": "@jupyter-widgets/base",
662
- "_view_module_version": "1.2.0",
663
- "_view_name": "LayoutView",
664
- "align_content": null,
665
- "align_items": null,
666
- "align_self": null,
667
- "border": null,
668
- "bottom": null,
669
- "display": null,
670
- "flex": null,
671
- "flex_flow": null,
672
- "grid_area": null,
673
- "grid_auto_columns": null,
674
- "grid_auto_flow": null,
675
- "grid_auto_rows": null,
676
- "grid_column": null,
677
- "grid_gap": null,
678
- "grid_row": null,
679
- "grid_template_areas": null,
680
- "grid_template_columns": null,
681
- "grid_template_rows": null,
682
- "height": null,
683
- "justify_content": null,
684
- "justify_items": null,
685
- "left": null,
686
- "margin": null,
687
- "max_height": null,
688
- "max_width": null,
689
- "min_height": null,
690
- "min_width": null,
691
- "object_fit": null,
692
- "object_position": null,
693
- "order": null,
694
- "overflow": null,
695
- "overflow_x": null,
696
- "overflow_y": null,
697
- "padding": null,
698
- "right": null,
699
- "top": null,
700
- "visibility": null,
701
- "width": null
702
- }
703
- },
704
- "3e4127ca08d3428a89f7041bec264f8a": {
705
- "model_module": "@jupyter-widgets/controls",
706
- "model_name": "DescriptionStyleModel",
707
- "model_module_version": "1.5.0",
708
- "state": {
709
- "_model_module": "@jupyter-widgets/controls",
710
- "_model_module_version": "1.5.0",
711
- "_model_name": "DescriptionStyleModel",
712
- "_view_count": null,
713
- "_view_module": "@jupyter-widgets/base",
714
- "_view_module_version": "1.2.0",
715
- "_view_name": "StyleView",
716
- "description_width": ""
717
- }
718
- }
719
- }
720
- },
721
- "accelerator": "GPU"
722
- },
723
- "nbformat": 4,
724
- "nbformat_minor": 5
725
- }