Spaces:
Sleeping
Sleeping
JAIGANESAN N
commited on
Commit
β’
471ad41
1
Parent(s):
c2b7d18
upgrade model from GPT-4o-mini to Gemini-1.5-flash
Browse files
notebooks/04-RAG_with_VectorStore.ipynb
CHANGED
@@ -3,10 +3,11 @@
|
|
3 |
{
|
4 |
"cell_type": "markdown",
|
5 |
"metadata": {
|
6 |
-
"id": "view-in-github"
|
|
|
7 |
},
|
8 |
"source": [
|
9 |
-
"<a href=\"https://colab.research.google.com/github/towardsai/ai-tutor-rag-system/blob/main/notebooks/04-RAG_with_VectorStore.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a
|
10 |
]
|
11 |
},
|
12 |
{
|
@@ -22,26 +23,30 @@
|
|
22 |
"cell_type": "code",
|
23 |
"execution_count": null,
|
24 |
"metadata": {
|
|
|
25 |
"id": "QPJzr-I9XQ7l"
|
26 |
},
|
27 |
"outputs": [],
|
28 |
"source": [
|
29 |
-
"!pip install -q llama-index==0.10.57 llama-index-vector-stores-chroma
|
30 |
]
|
31 |
},
|
32 |
{
|
33 |
"cell_type": "code",
|
34 |
-
"execution_count":
|
35 |
"metadata": {
|
36 |
"id": "riuXwpSPcvWC"
|
37 |
},
|
38 |
"outputs": [],
|
39 |
"source": [
|
40 |
"import os\n",
|
41 |
-
"\n",
|
42 |
"# Set the following API Keys in the Python environment. Will be used later.\n",
|
43 |
"os.environ[\"OPENAI_API_KEY\"] = \"<YOUR_API_KEY>\"\n",
|
44 |
-
"os.environ[\"GOOGLE_API_KEY\"] = \"<YOUR_API_KEY>\""
|
|
|
|
|
|
|
|
|
45 |
]
|
46 |
},
|
47 |
{
|
@@ -73,22 +78,22 @@
|
|
73 |
},
|
74 |
{
|
75 |
"cell_type": "code",
|
76 |
-
"execution_count":
|
77 |
"metadata": {
|
78 |
"colab": {
|
79 |
"base_uri": "https://localhost:8080/"
|
80 |
},
|
81 |
"id": "-QTUkdfJjY4N",
|
82 |
-
"outputId": "
|
83 |
},
|
84 |
"outputs": [
|
85 |
{
|
86 |
-
"name": "stdout",
|
87 |
"output_type": "stream",
|
|
|
88 |
"text": [
|
89 |
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
|
90 |
" Dload Upload Total Spent Left Speed\n",
|
91 |
-
"100 169k 100 169k 0 0
|
92 |
]
|
93 |
}
|
94 |
],
|
@@ -107,18 +112,18 @@
|
|
107 |
},
|
108 |
{
|
109 |
"cell_type": "code",
|
110 |
-
"execution_count":
|
111 |
"metadata": {
|
112 |
"colab": {
|
113 |
"base_uri": "https://localhost:8080/"
|
114 |
},
|
115 |
"id": "7CYwRT6R0o0I",
|
116 |
-
"outputId": "
|
117 |
},
|
118 |
"outputs": [
|
119 |
{
|
120 |
-
"name": "stdout",
|
121 |
"output_type": "stream",
|
|
|
122 |
"text": [
|
123 |
"171044\n"
|
124 |
]
|
@@ -153,18 +158,18 @@
|
|
153 |
},
|
154 |
{
|
155 |
"cell_type": "code",
|
156 |
-
"execution_count":
|
157 |
"metadata": {
|
158 |
"colab": {
|
159 |
"base_uri": "https://localhost:8080/"
|
160 |
},
|
161 |
"id": "STACTMUR1z9N",
|
162 |
-
"outputId": "
|
163 |
},
|
164 |
"outputs": [
|
165 |
{
|
166 |
-
"name": "stdout",
|
167 |
"output_type": "stream",
|
|
|
168 |
"text": [
|
169 |
"335\n"
|
170 |
]
|
@@ -192,7 +197,7 @@
|
|
192 |
},
|
193 |
{
|
194 |
"cell_type": "code",
|
195 |
-
"execution_count":
|
196 |
"metadata": {
|
197 |
"id": "CtdsIUQ81_hT"
|
198 |
},
|
@@ -215,7 +220,7 @@
|
|
215 |
},
|
216 |
{
|
217 |
"cell_type": "code",
|
218 |
-
"execution_count":
|
219 |
"metadata": {
|
220 |
"id": "mXi56KTXk2sp"
|
221 |
},
|
@@ -231,7 +236,7 @@
|
|
231 |
},
|
232 |
{
|
233 |
"cell_type": "code",
|
234 |
-
"execution_count":
|
235 |
"metadata": {
|
236 |
"id": "jKXURvLtkuTS"
|
237 |
},
|
@@ -247,20 +252,67 @@
|
|
247 |
},
|
248 |
{
|
249 |
"cell_type": "code",
|
250 |
-
"execution_count":
|
251 |
"metadata": {
|
252 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
},
|
254 |
"outputs": [
|
255 |
{
|
256 |
-
"
|
257 |
-
"
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
"
|
262 |
-
|
263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
264 |
}
|
265 |
],
|
266 |
"source": [
|
@@ -288,7 +340,7 @@
|
|
288 |
},
|
289 |
{
|
290 |
"cell_type": "code",
|
291 |
-
"execution_count":
|
292 |
"metadata": {
|
293 |
"id": "mzS13x1ZlZ5X"
|
294 |
},
|
@@ -306,20 +358,21 @@
|
|
306 |
},
|
307 |
{
|
308 |
"cell_type": "code",
|
309 |
-
"execution_count":
|
310 |
"metadata": {
|
|
|
311 |
"colab": {
|
312 |
-
"base_uri": "https://localhost:8080/"
|
|
|
313 |
},
|
314 |
-
"
|
315 |
-
"outputId": "5066a06c-77ff-48a2-ee61-3abe2e9755e2"
|
316 |
},
|
317 |
"outputs": [
|
318 |
{
|
319 |
-
"name": "stdout",
|
320 |
"output_type": "stream",
|
|
|
321 |
"text": [
|
322 |
-
"The
|
323 |
"\n"
|
324 |
]
|
325 |
}
|
@@ -340,7 +393,7 @@
|
|
340 |
},
|
341 |
{
|
342 |
"cell_type": "code",
|
343 |
-
"execution_count":
|
344 |
"metadata": {
|
345 |
"id": "SMPAniL2e4NP"
|
346 |
},
|
@@ -363,7 +416,7 @@
|
|
363 |
},
|
364 |
{
|
365 |
"cell_type": "code",
|
366 |
-
"execution_count":
|
367 |
"metadata": {
|
368 |
"id": "2xas7HkuhJ8A"
|
369 |
},
|
@@ -374,7 +427,7 @@
|
|
374 |
"\n",
|
375 |
"# Add the documents to chroma DB and create Index / embeddings\n",
|
376 |
"\n",
|
377 |
-
"embeddings = OpenAIEmbeddings(model=\"text-embedding-
|
378 |
"chroma_db = Chroma.from_documents(\n",
|
379 |
" documents=documents,\n",
|
380 |
" embedding=embeddings,\n",
|
@@ -400,40 +453,65 @@
|
|
400 |
},
|
401 |
"outputs": [],
|
402 |
"source": [
|
403 |
-
"from
|
404 |
"\n",
|
405 |
"# Initializing the LLM model\n",
|
406 |
-
"llm = ChatOpenAI(temperature=0, model=\"gpt-4o-mini\", max_tokens=512)"
|
|
|
|
|
|
|
|
|
|
|
|
|
407 |
]
|
408 |
},
|
409 |
{
|
410 |
"cell_type": "code",
|
411 |
"execution_count": null,
|
412 |
"metadata": {
|
|
|
413 |
"colab": {
|
414 |
"base_uri": "https://localhost:8080/"
|
415 |
},
|
416 |
-
"
|
417 |
-
"outputId": "93c9ad64-1cd1-4f52-c51e-6f3ec5d6542d"
|
418 |
},
|
419 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
420 |
"source": [
|
421 |
"from langchain.chains import RetrievalQA\n",
|
422 |
"\n",
|
423 |
-
"query = \"How many parameters
|
424 |
-
"retriever = chroma_db.as_retriever(search_kwargs={\"k\":
|
425 |
"# Define a RetrievalQA chain that is responsible for retrieving related pieces of text,\n",
|
426 |
"# and using a LLM to formulate the final answer.\n",
|
427 |
"chain = RetrievalQA.from_chain_type(llm=llm, chain_type=\"stuff\", retriever=retriever)\n",
|
428 |
"\n",
|
429 |
-
"response = chain(query)\n",
|
430 |
"print(response[\"result\"])"
|
431 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
432 |
}
|
433 |
],
|
434 |
"metadata": {
|
435 |
"colab": {
|
436 |
-
"provenance": []
|
|
|
437 |
},
|
438 |
"kernelspec": {
|
439 |
"display_name": "Python 3",
|
@@ -450,8 +528,696 @@
|
|
450 |
"nbconvert_exporter": "python",
|
451 |
"pygments_lexer": "ipython3",
|
452 |
"version": "3.12.4"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
453 |
}
|
454 |
},
|
455 |
"nbformat": 4,
|
456 |
"nbformat_minor": 0
|
457 |
-
}
|
|
|
3 |
{
|
4 |
"cell_type": "markdown",
|
5 |
"metadata": {
|
6 |
+
"id": "view-in-github",
|
7 |
+
"colab_type": "text"
|
8 |
},
|
9 |
"source": [
|
10 |
+
"<a href=\"https://colab.research.google.com/github/towardsai/ai-tutor-rag-system/blob/main/notebooks/04-RAG_with_VectorStore.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
|
11 |
]
|
12 |
},
|
13 |
{
|
|
|
23 |
"cell_type": "code",
|
24 |
"execution_count": null,
|
25 |
"metadata": {
|
26 |
+
"collapsed": true,
|
27 |
"id": "QPJzr-I9XQ7l"
|
28 |
},
|
29 |
"outputs": [],
|
30 |
"source": [
|
31 |
+
"!pip install -q llama-index==0.10.57 llama-index-vector-stores-chroma llama-index-llms-gemini==0.1.11 langchain_google_genai google-generativeai==0.5.4 langchain==0.1.17 langchain-chroma langchain_openai==0.1.5 openai==1.37.0 chromadb"
|
32 |
]
|
33 |
},
|
34 |
{
|
35 |
"cell_type": "code",
|
36 |
+
"execution_count": null,
|
37 |
"metadata": {
|
38 |
"id": "riuXwpSPcvWC"
|
39 |
},
|
40 |
"outputs": [],
|
41 |
"source": [
|
42 |
"import os\n",
|
|
|
43 |
"# Set the following API Keys in the Python environment. Will be used later.\n",
|
44 |
"os.environ[\"OPENAI_API_KEY\"] = \"<YOUR_API_KEY>\"\n",
|
45 |
+
"os.environ[\"GOOGLE_API_KEY\"] = \"<YOUR_API_KEY>\"\n",
|
46 |
+
"\n",
|
47 |
+
"# from google.colab import userdata\n",
|
48 |
+
"# os.environ[\"OPENAI_API_KEY\"] = userdata.get('openai_api_key')\n",
|
49 |
+
"# os.environ[\"GOOGLE_API_KEY\"] = userdata.get('Google_api_key')"
|
50 |
]
|
51 |
},
|
52 |
{
|
|
|
78 |
},
|
79 |
{
|
80 |
"cell_type": "code",
|
81 |
+
"execution_count": null,
|
82 |
"metadata": {
|
83 |
"colab": {
|
84 |
"base_uri": "https://localhost:8080/"
|
85 |
},
|
86 |
"id": "-QTUkdfJjY4N",
|
87 |
+
"outputId": "34becd46-808a-42ee-e620-3e6b18f79e1d"
|
88 |
},
|
89 |
"outputs": [
|
90 |
{
|
|
|
91 |
"output_type": "stream",
|
92 |
+
"name": "stdout",
|
93 |
"text": [
|
94 |
" % Total % Received % Xferd Average Speed Time Time Time Current\n",
|
95 |
" Dload Upload Total Spent Left Speed\n",
|
96 |
+
"100 169k 100 169k 0 0 609k 0 --:--:-- --:--:-- --:--:-- 612k\n"
|
97 |
]
|
98 |
}
|
99 |
],
|
|
|
112 |
},
|
113 |
{
|
114 |
"cell_type": "code",
|
115 |
+
"execution_count": null,
|
116 |
"metadata": {
|
117 |
"colab": {
|
118 |
"base_uri": "https://localhost:8080/"
|
119 |
},
|
120 |
"id": "7CYwRT6R0o0I",
|
121 |
+
"outputId": "394603bd-6d33-40aa-8e06-6ef802879234"
|
122 |
},
|
123 |
"outputs": [
|
124 |
{
|
|
|
125 |
"output_type": "stream",
|
126 |
+
"name": "stdout",
|
127 |
"text": [
|
128 |
"171044\n"
|
129 |
]
|
|
|
158 |
},
|
159 |
{
|
160 |
"cell_type": "code",
|
161 |
+
"execution_count": null,
|
162 |
"metadata": {
|
163 |
"colab": {
|
164 |
"base_uri": "https://localhost:8080/"
|
165 |
},
|
166 |
"id": "STACTMUR1z9N",
|
167 |
+
"outputId": "d5360ce2-2c1e-459b-a3b3-e9899fe762b5"
|
168 |
},
|
169 |
"outputs": [
|
170 |
{
|
|
|
171 |
"output_type": "stream",
|
172 |
+
"name": "stdout",
|
173 |
"text": [
|
174 |
"335\n"
|
175 |
]
|
|
|
197 |
},
|
198 |
{
|
199 |
"cell_type": "code",
|
200 |
+
"execution_count": null,
|
201 |
"metadata": {
|
202 |
"id": "CtdsIUQ81_hT"
|
203 |
},
|
|
|
220 |
},
|
221 |
{
|
222 |
"cell_type": "code",
|
223 |
+
"execution_count": null,
|
224 |
"metadata": {
|
225 |
"id": "mXi56KTXk2sp"
|
226 |
},
|
|
|
236 |
},
|
237 |
{
|
238 |
"cell_type": "code",
|
239 |
+
"execution_count": null,
|
240 |
"metadata": {
|
241 |
"id": "jKXURvLtkuTS"
|
242 |
},
|
|
|
252 |
},
|
253 |
{
|
254 |
"cell_type": "code",
|
255 |
+
"execution_count": null,
|
256 |
"metadata": {
|
257 |
+
"colab": {
|
258 |
+
"base_uri": "https://localhost:8080/",
|
259 |
+
"height": 81,
|
260 |
+
"referenced_widgets": [
|
261 |
+
"1a0185d42be8489c87874049e5d78424",
|
262 |
+
"e91d7972a14b4444808d649d5db15b7a",
|
263 |
+
"bd3eab2dfee94512b88d88fbd4cb3682",
|
264 |
+
"3ba2fa0f0c8449c3a22ff3593d2b6629",
|
265 |
+
"eb7ce1338f6a4c9a8fb9a92e8de78821",
|
266 |
+
"d9daeb567dcc4387a7ba406a559aa422",
|
267 |
+
"2a99f51fa5c24ce09f629d9d5322879d",
|
268 |
+
"edfd151ed26646d8a6d293a3cf1ecce6",
|
269 |
+
"032b979544624bd4a9f7eb91fa9dd2e8",
|
270 |
+
"28d35749a3fa4c6f80f626221f95cde1",
|
271 |
+
"3d78bf2951e04c21bd89c1d944412e5a",
|
272 |
+
"a0991085ef794c8cbf509370b67df911",
|
273 |
+
"780fa2ff5938403cb2c109c491368dce",
|
274 |
+
"f833fd603aa543f59a7e93fe980935cc",
|
275 |
+
"48e949bbaf7c4079bbe8fcf620066b8e",
|
276 |
+
"78fd41df7f604f0290dc034c9f01a18c",
|
277 |
+
"d2df0b3067574d46b951890b996a5751",
|
278 |
+
"b51937856bf64803a85ea7eb30f73cfe",
|
279 |
+
"74fe3cd416994417a2138d8a32beeed8",
|
280 |
+
"80626b461cce49e7bcb6e3e931c5d81c",
|
281 |
+
"23f0bdb422384eaf94a69d20502fdbe4",
|
282 |
+
"dfa74d96a1174e7ead6554b5c984f526"
|
283 |
+
]
|
284 |
+
},
|
285 |
+
"id": "WsD52wtrlESi",
|
286 |
+
"outputId": "2d522a85-cdea-477b-a693-e26b404c8ed9"
|
287 |
},
|
288 |
"outputs": [
|
289 |
{
|
290 |
+
"output_type": "display_data",
|
291 |
+
"data": {
|
292 |
+
"text/plain": [
|
293 |
+
"Parsing nodes: 0%| | 0/335 [00:00<?, ?it/s]"
|
294 |
+
],
|
295 |
+
"application/vnd.jupyter.widget-view+json": {
|
296 |
+
"version_major": 2,
|
297 |
+
"version_minor": 0,
|
298 |
+
"model_id": "1a0185d42be8489c87874049e5d78424"
|
299 |
+
}
|
300 |
+
},
|
301 |
+
"metadata": {}
|
302 |
+
},
|
303 |
+
{
|
304 |
+
"output_type": "display_data",
|
305 |
+
"data": {
|
306 |
+
"text/plain": [
|
307 |
+
"Generating embeddings: 0%| | 0/335 [00:00<?, ?it/s]"
|
308 |
+
],
|
309 |
+
"application/vnd.jupyter.widget-view+json": {
|
310 |
+
"version_major": 2,
|
311 |
+
"version_minor": 0,
|
312 |
+
"model_id": "a0991085ef794c8cbf509370b67df911"
|
313 |
+
}
|
314 |
+
},
|
315 |
+
"metadata": {}
|
316 |
}
|
317 |
],
|
318 |
"source": [
|
|
|
340 |
},
|
341 |
{
|
342 |
"cell_type": "code",
|
343 |
+
"execution_count": null,
|
344 |
"metadata": {
|
345 |
"id": "mzS13x1ZlZ5X"
|
346 |
},
|
|
|
358 |
},
|
359 |
{
|
360 |
"cell_type": "code",
|
361 |
+
"execution_count": null,
|
362 |
"metadata": {
|
363 |
+
"id": "AYsQ4uLN_Oxg",
|
364 |
"colab": {
|
365 |
+
"base_uri": "https://localhost:8080/",
|
366 |
+
"height": 52
|
367 |
},
|
368 |
+
"outputId": "f56876cc-f7bc-4e63-bb7b-9515e9b404cc"
|
|
|
369 |
},
|
370 |
"outputs": [
|
371 |
{
|
|
|
372 |
"output_type": "stream",
|
373 |
+
"name": "stdout",
|
374 |
"text": [
|
375 |
+
"The LLaMA 2 model has four different sizes: 7 billion, 13 billion, 34 billion, and 70 billion parameters. \n",
|
376 |
"\n"
|
377 |
]
|
378 |
}
|
|
|
393 |
},
|
394 |
{
|
395 |
"cell_type": "code",
|
396 |
+
"execution_count": null,
|
397 |
"metadata": {
|
398 |
"id": "SMPAniL2e4NP"
|
399 |
},
|
|
|
416 |
},
|
417 |
{
|
418 |
"cell_type": "code",
|
419 |
+
"execution_count": null,
|
420 |
"metadata": {
|
421 |
"id": "2xas7HkuhJ8A"
|
422 |
},
|
|
|
427 |
"\n",
|
428 |
"# Add the documents to chroma DB and create Index / embeddings\n",
|
429 |
"\n",
|
430 |
+
"embeddings = OpenAIEmbeddings(model=\"text-embedding-3-small\")\n",
|
431 |
"chroma_db = Chroma.from_documents(\n",
|
432 |
" documents=documents,\n",
|
433 |
" embedding=embeddings,\n",
|
|
|
453 |
},
|
454 |
"outputs": [],
|
455 |
"source": [
|
456 |
+
"from langchain_google_genai import ChatGoogleGenerativeAI\n",
|
457 |
"\n",
|
458 |
"# Initializing the LLM model\n",
|
459 |
+
"#llm = ChatOpenAI(temperature=0, model=\"gpt-4o-mini\", max_tokens=512)\n",
|
460 |
+
"\n",
|
461 |
+
"llm = ChatGoogleGenerativeAI(\n",
|
462 |
+
" model=\"gemini-1.5-flash\",\n",
|
463 |
+
" temperature=0,\n",
|
464 |
+
" max_tokens=512,\n",
|
465 |
+
")"
|
466 |
]
|
467 |
},
|
468 |
{
|
469 |
"cell_type": "code",
|
470 |
"execution_count": null,
|
471 |
"metadata": {
|
472 |
+
"id": "AxBqPNtthPaa",
|
473 |
"colab": {
|
474 |
"base_uri": "https://localhost:8080/"
|
475 |
},
|
476 |
+
"outputId": "607b082a-66c2-49a2-ca59-b3cb85bf6067"
|
|
|
477 |
},
|
478 |
+
"outputs": [
|
479 |
+
{
|
480 |
+
"output_type": "stream",
|
481 |
+
"name": "stdout",
|
482 |
+
"text": [
|
483 |
+
"The LLaMA 2 model comes in four different sizes: 7 billion, 13 billion, 34 billion, and 70 billion parameters. \n",
|
484 |
+
"\n"
|
485 |
+
]
|
486 |
+
}
|
487 |
+
],
|
488 |
"source": [
|
489 |
"from langchain.chains import RetrievalQA\n",
|
490 |
"\n",
|
491 |
+
"query = \"How many parameters LLaMA 2 model has?\"\n",
|
492 |
+
"retriever = chroma_db.as_retriever(search_kwargs={\"k\": 4})\n",
|
493 |
"# Define a RetrievalQA chain that is responsible for retrieving related pieces of text,\n",
|
494 |
"# and using a LLM to formulate the final answer.\n",
|
495 |
"chain = RetrievalQA.from_chain_type(llm=llm, chain_type=\"stuff\", retriever=retriever)\n",
|
496 |
"\n",
|
497 |
+
"response = chain.invoke(query)\n",
|
498 |
"print(response[\"result\"])"
|
499 |
]
|
500 |
+
},
|
501 |
+
{
|
502 |
+
"cell_type": "code",
|
503 |
+
"execution_count": null,
|
504 |
+
"metadata": {
|
505 |
+
"id": "AKr16L_kwyYX"
|
506 |
+
},
|
507 |
+
"outputs": [],
|
508 |
+
"source": []
|
509 |
}
|
510 |
],
|
511 |
"metadata": {
|
512 |
"colab": {
|
513 |
+
"provenance": [],
|
514 |
+
"include_colab_link": true
|
515 |
},
|
516 |
"kernelspec": {
|
517 |
"display_name": "Python 3",
|
|
|
528 |
"nbconvert_exporter": "python",
|
529 |
"pygments_lexer": "ipython3",
|
530 |
"version": "3.12.4"
|
531 |
+
},
|
532 |
+
"widgets": {
|
533 |
+
"application/vnd.jupyter.widget-state+json": {
|
534 |
+
"1a0185d42be8489c87874049e5d78424": {
|
535 |
+
"model_module": "@jupyter-widgets/controls",
|
536 |
+
"model_name": "HBoxModel",
|
537 |
+
"model_module_version": "1.5.0",
|
538 |
+
"state": {
|
539 |
+
"_dom_classes": [],
|
540 |
+
"_model_module": "@jupyter-widgets/controls",
|
541 |
+
"_model_module_version": "1.5.0",
|
542 |
+
"_model_name": "HBoxModel",
|
543 |
+
"_view_count": null,
|
544 |
+
"_view_module": "@jupyter-widgets/controls",
|
545 |
+
"_view_module_version": "1.5.0",
|
546 |
+
"_view_name": "HBoxView",
|
547 |
+
"box_style": "",
|
548 |
+
"children": [
|
549 |
+
"IPY_MODEL_e91d7972a14b4444808d649d5db15b7a",
|
550 |
+
"IPY_MODEL_bd3eab2dfee94512b88d88fbd4cb3682",
|
551 |
+
"IPY_MODEL_3ba2fa0f0c8449c3a22ff3593d2b6629"
|
552 |
+
],
|
553 |
+
"layout": "IPY_MODEL_eb7ce1338f6a4c9a8fb9a92e8de78821"
|
554 |
+
}
|
555 |
+
},
|
556 |
+
"e91d7972a14b4444808d649d5db15b7a": {
|
557 |
+
"model_module": "@jupyter-widgets/controls",
|
558 |
+
"model_name": "HTMLModel",
|
559 |
+
"model_module_version": "1.5.0",
|
560 |
+
"state": {
|
561 |
+
"_dom_classes": [],
|
562 |
+
"_model_module": "@jupyter-widgets/controls",
|
563 |
+
"_model_module_version": "1.5.0",
|
564 |
+
"_model_name": "HTMLModel",
|
565 |
+
"_view_count": null,
|
566 |
+
"_view_module": "@jupyter-widgets/controls",
|
567 |
+
"_view_module_version": "1.5.0",
|
568 |
+
"_view_name": "HTMLView",
|
569 |
+
"description": "",
|
570 |
+
"description_tooltip": null,
|
571 |
+
"layout": "IPY_MODEL_d9daeb567dcc4387a7ba406a559aa422",
|
572 |
+
"placeholder": "β",
|
573 |
+
"style": "IPY_MODEL_2a99f51fa5c24ce09f629d9d5322879d",
|
574 |
+
"value": "Parsingβnodes:β100%"
|
575 |
+
}
|
576 |
+
},
|
577 |
+
"bd3eab2dfee94512b88d88fbd4cb3682": {
|
578 |
+
"model_module": "@jupyter-widgets/controls",
|
579 |
+
"model_name": "FloatProgressModel",
|
580 |
+
"model_module_version": "1.5.0",
|
581 |
+
"state": {
|
582 |
+
"_dom_classes": [],
|
583 |
+
"_model_module": "@jupyter-widgets/controls",
|
584 |
+
"_model_module_version": "1.5.0",
|
585 |
+
"_model_name": "FloatProgressModel",
|
586 |
+
"_view_count": null,
|
587 |
+
"_view_module": "@jupyter-widgets/controls",
|
588 |
+
"_view_module_version": "1.5.0",
|
589 |
+
"_view_name": "ProgressView",
|
590 |
+
"bar_style": "success",
|
591 |
+
"description": "",
|
592 |
+
"description_tooltip": null,
|
593 |
+
"layout": "IPY_MODEL_edfd151ed26646d8a6d293a3cf1ecce6",
|
594 |
+
"max": 335,
|
595 |
+
"min": 0,
|
596 |
+
"orientation": "horizontal",
|
597 |
+
"style": "IPY_MODEL_032b979544624bd4a9f7eb91fa9dd2e8",
|
598 |
+
"value": 335
|
599 |
+
}
|
600 |
+
},
|
601 |
+
"3ba2fa0f0c8449c3a22ff3593d2b6629": {
|
602 |
+
"model_module": "@jupyter-widgets/controls",
|
603 |
+
"model_name": "HTMLModel",
|
604 |
+
"model_module_version": "1.5.0",
|
605 |
+
"state": {
|
606 |
+
"_dom_classes": [],
|
607 |
+
"_model_module": "@jupyter-widgets/controls",
|
608 |
+
"_model_module_version": "1.5.0",
|
609 |
+
"_model_name": "HTMLModel",
|
610 |
+
"_view_count": null,
|
611 |
+
"_view_module": "@jupyter-widgets/controls",
|
612 |
+
"_view_module_version": "1.5.0",
|
613 |
+
"_view_name": "HTMLView",
|
614 |
+
"description": "",
|
615 |
+
"description_tooltip": null,
|
616 |
+
"layout": "IPY_MODEL_28d35749a3fa4c6f80f626221f95cde1",
|
617 |
+
"placeholder": "β",
|
618 |
+
"style": "IPY_MODEL_3d78bf2951e04c21bd89c1d944412e5a",
|
619 |
+
"value": "β335/335β[00:00<00:00,β3304.59it/s]"
|
620 |
+
}
|
621 |
+
},
|
622 |
+
"eb7ce1338f6a4c9a8fb9a92e8de78821": {
|
623 |
+
"model_module": "@jupyter-widgets/base",
|
624 |
+
"model_name": "LayoutModel",
|
625 |
+
"model_module_version": "1.2.0",
|
626 |
+
"state": {
|
627 |
+
"_model_module": "@jupyter-widgets/base",
|
628 |
+
"_model_module_version": "1.2.0",
|
629 |
+
"_model_name": "LayoutModel",
|
630 |
+
"_view_count": null,
|
631 |
+
"_view_module": "@jupyter-widgets/base",
|
632 |
+
"_view_module_version": "1.2.0",
|
633 |
+
"_view_name": "LayoutView",
|
634 |
+
"align_content": null,
|
635 |
+
"align_items": null,
|
636 |
+
"align_self": null,
|
637 |
+
"border": null,
|
638 |
+
"bottom": null,
|
639 |
+
"display": null,
|
640 |
+
"flex": null,
|
641 |
+
"flex_flow": null,
|
642 |
+
"grid_area": null,
|
643 |
+
"grid_auto_columns": null,
|
644 |
+
"grid_auto_flow": null,
|
645 |
+
"grid_auto_rows": null,
|
646 |
+
"grid_column": null,
|
647 |
+
"grid_gap": null,
|
648 |
+
"grid_row": null,
|
649 |
+
"grid_template_areas": null,
|
650 |
+
"grid_template_columns": null,
|
651 |
+
"grid_template_rows": null,
|
652 |
+
"height": null,
|
653 |
+
"justify_content": null,
|
654 |
+
"justify_items": null,
|
655 |
+
"left": null,
|
656 |
+
"margin": null,
|
657 |
+
"max_height": null,
|
658 |
+
"max_width": null,
|
659 |
+
"min_height": null,
|
660 |
+
"min_width": null,
|
661 |
+
"object_fit": null,
|
662 |
+
"object_position": null,
|
663 |
+
"order": null,
|
664 |
+
"overflow": null,
|
665 |
+
"overflow_x": null,
|
666 |
+
"overflow_y": null,
|
667 |
+
"padding": null,
|
668 |
+
"right": null,
|
669 |
+
"top": null,
|
670 |
+
"visibility": null,
|
671 |
+
"width": null
|
672 |
+
}
|
673 |
+
},
|
674 |
+
"d9daeb567dcc4387a7ba406a559aa422": {
|
675 |
+
"model_module": "@jupyter-widgets/base",
|
676 |
+
"model_name": "LayoutModel",
|
677 |
+
"model_module_version": "1.2.0",
|
678 |
+
"state": {
|
679 |
+
"_model_module": "@jupyter-widgets/base",
|
680 |
+
"_model_module_version": "1.2.0",
|
681 |
+
"_model_name": "LayoutModel",
|
682 |
+
"_view_count": null,
|
683 |
+
"_view_module": "@jupyter-widgets/base",
|
684 |
+
"_view_module_version": "1.2.0",
|
685 |
+
"_view_name": "LayoutView",
|
686 |
+
"align_content": null,
|
687 |
+
"align_items": null,
|
688 |
+
"align_self": null,
|
689 |
+
"border": null,
|
690 |
+
"bottom": null,
|
691 |
+
"display": null,
|
692 |
+
"flex": null,
|
693 |
+
"flex_flow": null,
|
694 |
+
"grid_area": null,
|
695 |
+
"grid_auto_columns": null,
|
696 |
+
"grid_auto_flow": null,
|
697 |
+
"grid_auto_rows": null,
|
698 |
+
"grid_column": null,
|
699 |
+
"grid_gap": null,
|
700 |
+
"grid_row": null,
|
701 |
+
"grid_template_areas": null,
|
702 |
+
"grid_template_columns": null,
|
703 |
+
"grid_template_rows": null,
|
704 |
+
"height": null,
|
705 |
+
"justify_content": null,
|
706 |
+
"justify_items": null,
|
707 |
+
"left": null,
|
708 |
+
"margin": null,
|
709 |
+
"max_height": null,
|
710 |
+
"max_width": null,
|
711 |
+
"min_height": null,
|
712 |
+
"min_width": null,
|
713 |
+
"object_fit": null,
|
714 |
+
"object_position": null,
|
715 |
+
"order": null,
|
716 |
+
"overflow": null,
|
717 |
+
"overflow_x": null,
|
718 |
+
"overflow_y": null,
|
719 |
+
"padding": null,
|
720 |
+
"right": null,
|
721 |
+
"top": null,
|
722 |
+
"visibility": null,
|
723 |
+
"width": null
|
724 |
+
}
|
725 |
+
},
|
726 |
+
"2a99f51fa5c24ce09f629d9d5322879d": {
|
727 |
+
"model_module": "@jupyter-widgets/controls",
|
728 |
+
"model_name": "DescriptionStyleModel",
|
729 |
+
"model_module_version": "1.5.0",
|
730 |
+
"state": {
|
731 |
+
"_model_module": "@jupyter-widgets/controls",
|
732 |
+
"_model_module_version": "1.5.0",
|
733 |
+
"_model_name": "DescriptionStyleModel",
|
734 |
+
"_view_count": null,
|
735 |
+
"_view_module": "@jupyter-widgets/base",
|
736 |
+
"_view_module_version": "1.2.0",
|
737 |
+
"_view_name": "StyleView",
|
738 |
+
"description_width": ""
|
739 |
+
}
|
740 |
+
},
|
741 |
+
"edfd151ed26646d8a6d293a3cf1ecce6": {
|
742 |
+
"model_module": "@jupyter-widgets/base",
|
743 |
+
"model_name": "LayoutModel",
|
744 |
+
"model_module_version": "1.2.0",
|
745 |
+
"state": {
|
746 |
+
"_model_module": "@jupyter-widgets/base",
|
747 |
+
"_model_module_version": "1.2.0",
|
748 |
+
"_model_name": "LayoutModel",
|
749 |
+
"_view_count": null,
|
750 |
+
"_view_module": "@jupyter-widgets/base",
|
751 |
+
"_view_module_version": "1.2.0",
|
752 |
+
"_view_name": "LayoutView",
|
753 |
+
"align_content": null,
|
754 |
+
"align_items": null,
|
755 |
+
"align_self": null,
|
756 |
+
"border": null,
|
757 |
+
"bottom": null,
|
758 |
+
"display": null,
|
759 |
+
"flex": null,
|
760 |
+
"flex_flow": null,
|
761 |
+
"grid_area": null,
|
762 |
+
"grid_auto_columns": null,
|
763 |
+
"grid_auto_flow": null,
|
764 |
+
"grid_auto_rows": null,
|
765 |
+
"grid_column": null,
|
766 |
+
"grid_gap": null,
|
767 |
+
"grid_row": null,
|
768 |
+
"grid_template_areas": null,
|
769 |
+
"grid_template_columns": null,
|
770 |
+
"grid_template_rows": null,
|
771 |
+
"height": null,
|
772 |
+
"justify_content": null,
|
773 |
+
"justify_items": null,
|
774 |
+
"left": null,
|
775 |
+
"margin": null,
|
776 |
+
"max_height": null,
|
777 |
+
"max_width": null,
|
778 |
+
"min_height": null,
|
779 |
+
"min_width": null,
|
780 |
+
"object_fit": null,
|
781 |
+
"object_position": null,
|
782 |
+
"order": null,
|
783 |
+
"overflow": null,
|
784 |
+
"overflow_x": null,
|
785 |
+
"overflow_y": null,
|
786 |
+
"padding": null,
|
787 |
+
"right": null,
|
788 |
+
"top": null,
|
789 |
+
"visibility": null,
|
790 |
+
"width": null
|
791 |
+
}
|
792 |
+
},
|
793 |
+
"032b979544624bd4a9f7eb91fa9dd2e8": {
|
794 |
+
"model_module": "@jupyter-widgets/controls",
|
795 |
+
"model_name": "ProgressStyleModel",
|
796 |
+
"model_module_version": "1.5.0",
|
797 |
+
"state": {
|
798 |
+
"_model_module": "@jupyter-widgets/controls",
|
799 |
+
"_model_module_version": "1.5.0",
|
800 |
+
"_model_name": "ProgressStyleModel",
|
801 |
+
"_view_count": null,
|
802 |
+
"_view_module": "@jupyter-widgets/base",
|
803 |
+
"_view_module_version": "1.2.0",
|
804 |
+
"_view_name": "StyleView",
|
805 |
+
"bar_color": null,
|
806 |
+
"description_width": ""
|
807 |
+
}
|
808 |
+
},
|
809 |
+
"28d35749a3fa4c6f80f626221f95cde1": {
|
810 |
+
"model_module": "@jupyter-widgets/base",
|
811 |
+
"model_name": "LayoutModel",
|
812 |
+
"model_module_version": "1.2.0",
|
813 |
+
"state": {
|
814 |
+
"_model_module": "@jupyter-widgets/base",
|
815 |
+
"_model_module_version": "1.2.0",
|
816 |
+
"_model_name": "LayoutModel",
|
817 |
+
"_view_count": null,
|
818 |
+
"_view_module": "@jupyter-widgets/base",
|
819 |
+
"_view_module_version": "1.2.0",
|
820 |
+
"_view_name": "LayoutView",
|
821 |
+
"align_content": null,
|
822 |
+
"align_items": null,
|
823 |
+
"align_self": null,
|
824 |
+
"border": null,
|
825 |
+
"bottom": null,
|
826 |
+
"display": null,
|
827 |
+
"flex": null,
|
828 |
+
"flex_flow": null,
|
829 |
+
"grid_area": null,
|
830 |
+
"grid_auto_columns": null,
|
831 |
+
"grid_auto_flow": null,
|
832 |
+
"grid_auto_rows": null,
|
833 |
+
"grid_column": null,
|
834 |
+
"grid_gap": null,
|
835 |
+
"grid_row": null,
|
836 |
+
"grid_template_areas": null,
|
837 |
+
"grid_template_columns": null,
|
838 |
+
"grid_template_rows": null,
|
839 |
+
"height": null,
|
840 |
+
"justify_content": null,
|
841 |
+
"justify_items": null,
|
842 |
+
"left": null,
|
843 |
+
"margin": null,
|
844 |
+
"max_height": null,
|
845 |
+
"max_width": null,
|
846 |
+
"min_height": null,
|
847 |
+
"min_width": null,
|
848 |
+
"object_fit": null,
|
849 |
+
"object_position": null,
|
850 |
+
"order": null,
|
851 |
+
"overflow": null,
|
852 |
+
"overflow_x": null,
|
853 |
+
"overflow_y": null,
|
854 |
+
"padding": null,
|
855 |
+
"right": null,
|
856 |
+
"top": null,
|
857 |
+
"visibility": null,
|
858 |
+
"width": null
|
859 |
+
}
|
860 |
+
},
|
861 |
+
"3d78bf2951e04c21bd89c1d944412e5a": {
|
862 |
+
"model_module": "@jupyter-widgets/controls",
|
863 |
+
"model_name": "DescriptionStyleModel",
|
864 |
+
"model_module_version": "1.5.0",
|
865 |
+
"state": {
|
866 |
+
"_model_module": "@jupyter-widgets/controls",
|
867 |
+
"_model_module_version": "1.5.0",
|
868 |
+
"_model_name": "DescriptionStyleModel",
|
869 |
+
"_view_count": null,
|
870 |
+
"_view_module": "@jupyter-widgets/base",
|
871 |
+
"_view_module_version": "1.2.0",
|
872 |
+
"_view_name": "StyleView",
|
873 |
+
"description_width": ""
|
874 |
+
}
|
875 |
+
},
|
876 |
+
"a0991085ef794c8cbf509370b67df911": {
|
877 |
+
"model_module": "@jupyter-widgets/controls",
|
878 |
+
"model_name": "HBoxModel",
|
879 |
+
"model_module_version": "1.5.0",
|
880 |
+
"state": {
|
881 |
+
"_dom_classes": [],
|
882 |
+
"_model_module": "@jupyter-widgets/controls",
|
883 |
+
"_model_module_version": "1.5.0",
|
884 |
+
"_model_name": "HBoxModel",
|
885 |
+
"_view_count": null,
|
886 |
+
"_view_module": "@jupyter-widgets/controls",
|
887 |
+
"_view_module_version": "1.5.0",
|
888 |
+
"_view_name": "HBoxView",
|
889 |
+
"box_style": "",
|
890 |
+
"children": [
|
891 |
+
"IPY_MODEL_780fa2ff5938403cb2c109c491368dce",
|
892 |
+
"IPY_MODEL_f833fd603aa543f59a7e93fe980935cc",
|
893 |
+
"IPY_MODEL_48e949bbaf7c4079bbe8fcf620066b8e"
|
894 |
+
],
|
895 |
+
"layout": "IPY_MODEL_78fd41df7f604f0290dc034c9f01a18c"
|
896 |
+
}
|
897 |
+
},
|
898 |
+
"780fa2ff5938403cb2c109c491368dce": {
|
899 |
+
"model_module": "@jupyter-widgets/controls",
|
900 |
+
"model_name": "HTMLModel",
|
901 |
+
"model_module_version": "1.5.0",
|
902 |
+
"state": {
|
903 |
+
"_dom_classes": [],
|
904 |
+
"_model_module": "@jupyter-widgets/controls",
|
905 |
+
"_model_module_version": "1.5.0",
|
906 |
+
"_model_name": "HTMLModel",
|
907 |
+
"_view_count": null,
|
908 |
+
"_view_module": "@jupyter-widgets/controls",
|
909 |
+
"_view_module_version": "1.5.0",
|
910 |
+
"_view_name": "HTMLView",
|
911 |
+
"description": "",
|
912 |
+
"description_tooltip": null,
|
913 |
+
"layout": "IPY_MODEL_d2df0b3067574d46b951890b996a5751",
|
914 |
+
"placeholder": "β",
|
915 |
+
"style": "IPY_MODEL_b51937856bf64803a85ea7eb30f73cfe",
|
916 |
+
"value": "Generatingβembeddings:β100%"
|
917 |
+
}
|
918 |
+
},
|
919 |
+
"f833fd603aa543f59a7e93fe980935cc": {
|
920 |
+
"model_module": "@jupyter-widgets/controls",
|
921 |
+
"model_name": "FloatProgressModel",
|
922 |
+
"model_module_version": "1.5.0",
|
923 |
+
"state": {
|
924 |
+
"_dom_classes": [],
|
925 |
+
"_model_module": "@jupyter-widgets/controls",
|
926 |
+
"_model_module_version": "1.5.0",
|
927 |
+
"_model_name": "FloatProgressModel",
|
928 |
+
"_view_count": null,
|
929 |
+
"_view_module": "@jupyter-widgets/controls",
|
930 |
+
"_view_module_version": "1.5.0",
|
931 |
+
"_view_name": "ProgressView",
|
932 |
+
"bar_style": "success",
|
933 |
+
"description": "",
|
934 |
+
"description_tooltip": null,
|
935 |
+
"layout": "IPY_MODEL_74fe3cd416994417a2138d8a32beeed8",
|
936 |
+
"max": 335,
|
937 |
+
"min": 0,
|
938 |
+
"orientation": "horizontal",
|
939 |
+
"style": "IPY_MODEL_80626b461cce49e7bcb6e3e931c5d81c",
|
940 |
+
"value": 335
|
941 |
+
}
|
942 |
+
},
|
943 |
+
"48e949bbaf7c4079bbe8fcf620066b8e": {
|
944 |
+
"model_module": "@jupyter-widgets/controls",
|
945 |
+
"model_name": "HTMLModel",
|
946 |
+
"model_module_version": "1.5.0",
|
947 |
+
"state": {
|
948 |
+
"_dom_classes": [],
|
949 |
+
"_model_module": "@jupyter-widgets/controls",
|
950 |
+
"_model_module_version": "1.5.0",
|
951 |
+
"_model_name": "HTMLModel",
|
952 |
+
"_view_count": null,
|
953 |
+
"_view_module": "@jupyter-widgets/controls",
|
954 |
+
"_view_module_version": "1.5.0",
|
955 |
+
"_view_name": "HTMLView",
|
956 |
+
"description": "",
|
957 |
+
"description_tooltip": null,
|
958 |
+
"layout": "IPY_MODEL_23f0bdb422384eaf94a69d20502fdbe4",
|
959 |
+
"placeholder": "β",
|
960 |
+
"style": "IPY_MODEL_dfa74d96a1174e7ead6554b5c984f526",
|
961 |
+
"value": "β335/335β[00:03<00:00,β89.38it/s]"
|
962 |
+
}
|
963 |
+
},
|
964 |
+
"78fd41df7f604f0290dc034c9f01a18c": {
|
965 |
+
"model_module": "@jupyter-widgets/base",
|
966 |
+
"model_name": "LayoutModel",
|
967 |
+
"model_module_version": "1.2.0",
|
968 |
+
"state": {
|
969 |
+
"_model_module": "@jupyter-widgets/base",
|
970 |
+
"_model_module_version": "1.2.0",
|
971 |
+
"_model_name": "LayoutModel",
|
972 |
+
"_view_count": null,
|
973 |
+
"_view_module": "@jupyter-widgets/base",
|
974 |
+
"_view_module_version": "1.2.0",
|
975 |
+
"_view_name": "LayoutView",
|
976 |
+
"align_content": null,
|
977 |
+
"align_items": null,
|
978 |
+
"align_self": null,
|
979 |
+
"border": null,
|
980 |
+
"bottom": null,
|
981 |
+
"display": null,
|
982 |
+
"flex": null,
|
983 |
+
"flex_flow": null,
|
984 |
+
"grid_area": null,
|
985 |
+
"grid_auto_columns": null,
|
986 |
+
"grid_auto_flow": null,
|
987 |
+
"grid_auto_rows": null,
|
988 |
+
"grid_column": null,
|
989 |
+
"grid_gap": null,
|
990 |
+
"grid_row": null,
|
991 |
+
"grid_template_areas": null,
|
992 |
+
"grid_template_columns": null,
|
993 |
+
"grid_template_rows": null,
|
994 |
+
"height": null,
|
995 |
+
"justify_content": null,
|
996 |
+
"justify_items": null,
|
997 |
+
"left": null,
|
998 |
+
"margin": null,
|
999 |
+
"max_height": null,
|
1000 |
+
"max_width": null,
|
1001 |
+
"min_height": null,
|
1002 |
+
"min_width": null,
|
1003 |
+
"object_fit": null,
|
1004 |
+
"object_position": null,
|
1005 |
+
"order": null,
|
1006 |
+
"overflow": null,
|
1007 |
+
"overflow_x": null,
|
1008 |
+
"overflow_y": null,
|
1009 |
+
"padding": null,
|
1010 |
+
"right": null,
|
1011 |
+
"top": null,
|
1012 |
+
"visibility": null,
|
1013 |
+
"width": null
|
1014 |
+
}
|
1015 |
+
},
|
1016 |
+
"d2df0b3067574d46b951890b996a5751": {
|
1017 |
+
"model_module": "@jupyter-widgets/base",
|
1018 |
+
"model_name": "LayoutModel",
|
1019 |
+
"model_module_version": "1.2.0",
|
1020 |
+
"state": {
|
1021 |
+
"_model_module": "@jupyter-widgets/base",
|
1022 |
+
"_model_module_version": "1.2.0",
|
1023 |
+
"_model_name": "LayoutModel",
|
1024 |
+
"_view_count": null,
|
1025 |
+
"_view_module": "@jupyter-widgets/base",
|
1026 |
+
"_view_module_version": "1.2.0",
|
1027 |
+
"_view_name": "LayoutView",
|
1028 |
+
"align_content": null,
|
1029 |
+
"align_items": null,
|
1030 |
+
"align_self": null,
|
1031 |
+
"border": null,
|
1032 |
+
"bottom": null,
|
1033 |
+
"display": null,
|
1034 |
+
"flex": null,
|
1035 |
+
"flex_flow": null,
|
1036 |
+
"grid_area": null,
|
1037 |
+
"grid_auto_columns": null,
|
1038 |
+
"grid_auto_flow": null,
|
1039 |
+
"grid_auto_rows": null,
|
1040 |
+
"grid_column": null,
|
1041 |
+
"grid_gap": null,
|
1042 |
+
"grid_row": null,
|
1043 |
+
"grid_template_areas": null,
|
1044 |
+
"grid_template_columns": null,
|
1045 |
+
"grid_template_rows": null,
|
1046 |
+
"height": null,
|
1047 |
+
"justify_content": null,
|
1048 |
+
"justify_items": null,
|
1049 |
+
"left": null,
|
1050 |
+
"margin": null,
|
1051 |
+
"max_height": null,
|
1052 |
+
"max_width": null,
|
1053 |
+
"min_height": null,
|
1054 |
+
"min_width": null,
|
1055 |
+
"object_fit": null,
|
1056 |
+
"object_position": null,
|
1057 |
+
"order": null,
|
1058 |
+
"overflow": null,
|
1059 |
+
"overflow_x": null,
|
1060 |
+
"overflow_y": null,
|
1061 |
+
"padding": null,
|
1062 |
+
"right": null,
|
1063 |
+
"top": null,
|
1064 |
+
"visibility": null,
|
1065 |
+
"width": null
|
1066 |
+
}
|
1067 |
+
},
|
1068 |
+
"b51937856bf64803a85ea7eb30f73cfe": {
|
1069 |
+
"model_module": "@jupyter-widgets/controls",
|
1070 |
+
"model_name": "DescriptionStyleModel",
|
1071 |
+
"model_module_version": "1.5.0",
|
1072 |
+
"state": {
|
1073 |
+
"_model_module": "@jupyter-widgets/controls",
|
1074 |
+
"_model_module_version": "1.5.0",
|
1075 |
+
"_model_name": "DescriptionStyleModel",
|
1076 |
+
"_view_count": null,
|
1077 |
+
"_view_module": "@jupyter-widgets/base",
|
1078 |
+
"_view_module_version": "1.2.0",
|
1079 |
+
"_view_name": "StyleView",
|
1080 |
+
"description_width": ""
|
1081 |
+
}
|
1082 |
+
},
|
1083 |
+
"74fe3cd416994417a2138d8a32beeed8": {
|
1084 |
+
"model_module": "@jupyter-widgets/base",
|
1085 |
+
"model_name": "LayoutModel",
|
1086 |
+
"model_module_version": "1.2.0",
|
1087 |
+
"state": {
|
1088 |
+
"_model_module": "@jupyter-widgets/base",
|
1089 |
+
"_model_module_version": "1.2.0",
|
1090 |
+
"_model_name": "LayoutModel",
|
1091 |
+
"_view_count": null,
|
1092 |
+
"_view_module": "@jupyter-widgets/base",
|
1093 |
+
"_view_module_version": "1.2.0",
|
1094 |
+
"_view_name": "LayoutView",
|
1095 |
+
"align_content": null,
|
1096 |
+
"align_items": null,
|
1097 |
+
"align_self": null,
|
1098 |
+
"border": null,
|
1099 |
+
"bottom": null,
|
1100 |
+
"display": null,
|
1101 |
+
"flex": null,
|
1102 |
+
"flex_flow": null,
|
1103 |
+
"grid_area": null,
|
1104 |
+
"grid_auto_columns": null,
|
1105 |
+
"grid_auto_flow": null,
|
1106 |
+
"grid_auto_rows": null,
|
1107 |
+
"grid_column": null,
|
1108 |
+
"grid_gap": null,
|
1109 |
+
"grid_row": null,
|
1110 |
+
"grid_template_areas": null,
|
1111 |
+
"grid_template_columns": null,
|
1112 |
+
"grid_template_rows": null,
|
1113 |
+
"height": null,
|
1114 |
+
"justify_content": null,
|
1115 |
+
"justify_items": null,
|
1116 |
+
"left": null,
|
1117 |
+
"margin": null,
|
1118 |
+
"max_height": null,
|
1119 |
+
"max_width": null,
|
1120 |
+
"min_height": null,
|
1121 |
+
"min_width": null,
|
1122 |
+
"object_fit": null,
|
1123 |
+
"object_position": null,
|
1124 |
+
"order": null,
|
1125 |
+
"overflow": null,
|
1126 |
+
"overflow_x": null,
|
1127 |
+
"overflow_y": null,
|
1128 |
+
"padding": null,
|
1129 |
+
"right": null,
|
1130 |
+
"top": null,
|
1131 |
+
"visibility": null,
|
1132 |
+
"width": null
|
1133 |
+
}
|
1134 |
+
},
|
1135 |
+
"80626b461cce49e7bcb6e3e931c5d81c": {
|
1136 |
+
"model_module": "@jupyter-widgets/controls",
|
1137 |
+
"model_name": "ProgressStyleModel",
|
1138 |
+
"model_module_version": "1.5.0",
|
1139 |
+
"state": {
|
1140 |
+
"_model_module": "@jupyter-widgets/controls",
|
1141 |
+
"_model_module_version": "1.5.0",
|
1142 |
+
"_model_name": "ProgressStyleModel",
|
1143 |
+
"_view_count": null,
|
1144 |
+
"_view_module": "@jupyter-widgets/base",
|
1145 |
+
"_view_module_version": "1.2.0",
|
1146 |
+
"_view_name": "StyleView",
|
1147 |
+
"bar_color": null,
|
1148 |
+
"description_width": ""
|
1149 |
+
}
|
1150 |
+
},
|
1151 |
+
"23f0bdb422384eaf94a69d20502fdbe4": {
|
1152 |
+
"model_module": "@jupyter-widgets/base",
|
1153 |
+
"model_name": "LayoutModel",
|
1154 |
+
"model_module_version": "1.2.0",
|
1155 |
+
"state": {
|
1156 |
+
"_model_module": "@jupyter-widgets/base",
|
1157 |
+
"_model_module_version": "1.2.0",
|
1158 |
+
"_model_name": "LayoutModel",
|
1159 |
+
"_view_count": null,
|
1160 |
+
"_view_module": "@jupyter-widgets/base",
|
1161 |
+
"_view_module_version": "1.2.0",
|
1162 |
+
"_view_name": "LayoutView",
|
1163 |
+
"align_content": null,
|
1164 |
+
"align_items": null,
|
1165 |
+
"align_self": null,
|
1166 |
+
"border": null,
|
1167 |
+
"bottom": null,
|
1168 |
+
"display": null,
|
1169 |
+
"flex": null,
|
1170 |
+
"flex_flow": null,
|
1171 |
+
"grid_area": null,
|
1172 |
+
"grid_auto_columns": null,
|
1173 |
+
"grid_auto_flow": null,
|
1174 |
+
"grid_auto_rows": null,
|
1175 |
+
"grid_column": null,
|
1176 |
+
"grid_gap": null,
|
1177 |
+
"grid_row": null,
|
1178 |
+
"grid_template_areas": null,
|
1179 |
+
"grid_template_columns": null,
|
1180 |
+
"grid_template_rows": null,
|
1181 |
+
"height": null,
|
1182 |
+
"justify_content": null,
|
1183 |
+
"justify_items": null,
|
1184 |
+
"left": null,
|
1185 |
+
"margin": null,
|
1186 |
+
"max_height": null,
|
1187 |
+
"max_width": null,
|
1188 |
+
"min_height": null,
|
1189 |
+
"min_width": null,
|
1190 |
+
"object_fit": null,
|
1191 |
+
"object_position": null,
|
1192 |
+
"order": null,
|
1193 |
+
"overflow": null,
|
1194 |
+
"overflow_x": null,
|
1195 |
+
"overflow_y": null,
|
1196 |
+
"padding": null,
|
1197 |
+
"right": null,
|
1198 |
+
"top": null,
|
1199 |
+
"visibility": null,
|
1200 |
+
"width": null
|
1201 |
+
}
|
1202 |
+
},
|
1203 |
+
"dfa74d96a1174e7ead6554b5c984f526": {
|
1204 |
+
"model_module": "@jupyter-widgets/controls",
|
1205 |
+
"model_name": "DescriptionStyleModel",
|
1206 |
+
"model_module_version": "1.5.0",
|
1207 |
+
"state": {
|
1208 |
+
"_model_module": "@jupyter-widgets/controls",
|
1209 |
+
"_model_module_version": "1.5.0",
|
1210 |
+
"_model_name": "DescriptionStyleModel",
|
1211 |
+
"_view_count": null,
|
1212 |
+
"_view_module": "@jupyter-widgets/base",
|
1213 |
+
"_view_module_version": "1.2.0",
|
1214 |
+
"_view_name": "StyleView",
|
1215 |
+
"description_width": ""
|
1216 |
+
}
|
1217 |
+
}
|
1218 |
+
}
|
1219 |
}
|
1220 |
},
|
1221 |
"nbformat": 4,
|
1222 |
"nbformat_minor": 0
|
1223 |
+
}
|