Spaces:
Sleeping
Sleeping
S-MurilloG
commited on
Commit
•
f212b85
1
Parent(s):
7cbcfd5
LangChain
Browse files- CARSE_03_LangChain.ipynb +23 -23
CARSE_03_LangChain.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -11,7 +11,7 @@
|
|
11 |
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
-
"execution_count":
|
15 |
"metadata": {},
|
16 |
"outputs": [],
|
17 |
"source": [
|
@@ -23,7 +23,7 @@
|
|
23 |
},
|
24 |
{
|
25 |
"cell_type": "code",
|
26 |
-
"execution_count":
|
27 |
"metadata": {},
|
28 |
"outputs": [],
|
29 |
"source": [
|
@@ -41,7 +41,7 @@
|
|
41 |
},
|
42 |
{
|
43 |
"cell_type": "code",
|
44 |
-
"execution_count":
|
45 |
"metadata": {},
|
46 |
"outputs": [],
|
47 |
"source": [
|
@@ -50,7 +50,7 @@
|
|
50 |
},
|
51 |
{
|
52 |
"cell_type": "code",
|
53 |
-
"execution_count":
|
54 |
"metadata": {},
|
55 |
"outputs": [],
|
56 |
"source": [
|
@@ -61,16 +61,16 @@
|
|
61 |
},
|
62 |
{
|
63 |
"cell_type": "code",
|
64 |
-
"execution_count":
|
65 |
"metadata": {},
|
66 |
"outputs": [],
|
67 |
"source": [
|
68 |
-
"window_memory = ConversationBufferWindowMemory(k=
|
69 |
]
|
70 |
},
|
71 |
{
|
72 |
"cell_type": "code",
|
73 |
-
"execution_count":
|
74 |
"metadata": {},
|
75 |
"outputs": [],
|
76 |
"source": [
|
@@ -83,7 +83,7 @@
|
|
83 |
},
|
84 |
{
|
85 |
"cell_type": "code",
|
86 |
-
"execution_count":
|
87 |
"metadata": {},
|
88 |
"outputs": [
|
89 |
{
|
@@ -97,11 +97,8 @@
|
|
97 |
"\u001b[32;1m\u001b[1;3mThe following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n",
|
98 |
"\n",
|
99 |
"Current conversation:\n",
|
100 |
-
"
|
101 |
-
"
|
102 |
-
"Human: Bien bien, la verdad no me quejo nada\n",
|
103 |
-
"AI: Me alegra escuchar eso. Cómo estuvo tu día ayer?\n",
|
104 |
-
"Human: hace mucho calooor\n",
|
105 |
"AI:\u001b[0m\n",
|
106 |
"\n",
|
107 |
"\u001b[1m> Finished chain.\u001b[0m\n"
|
@@ -110,10 +107,10 @@
|
|
110 |
{
|
111 |
"data": {
|
112 |
"text/plain": [
|
113 |
-
"'
|
114 |
]
|
115 |
},
|
116 |
-
"execution_count":
|
117 |
"metadata": {},
|
118 |
"output_type": "execute_result"
|
119 |
}
|
@@ -125,25 +122,28 @@
|
|
125 |
},
|
126 |
{
|
127 |
"cell_type": "code",
|
128 |
-
"execution_count":
|
129 |
"metadata": {},
|
130 |
"outputs": [
|
131 |
{
|
132 |
"name": "stdout",
|
133 |
"output_type": "stream",
|
134 |
"text": [
|
135 |
-
"Human:
|
136 |
-
"AI:
|
137 |
-
"Human: Bien bien, la verdad no me quejo nada\n",
|
138 |
-
"AI: Me alegra escuchar eso. Cómo estuvo tu día ayer?\n",
|
139 |
-
"Human: hace mucho calooor\n",
|
140 |
-
"AI: Sí, el clima ha estado muy caliente últimamente. Dónde estabas?\n"
|
141 |
]
|
142 |
}
|
143 |
],
|
144 |
"source": [
|
145 |
"print(conversation.memory.buffer)"
|
146 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
147 |
}
|
148 |
],
|
149 |
"metadata": {
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
11 |
},
|
12 |
{
|
13 |
"cell_type": "code",
|
14 |
+
"execution_count": 2,
|
15 |
"metadata": {},
|
16 |
"outputs": [],
|
17 |
"source": [
|
|
|
23 |
},
|
24 |
{
|
25 |
"cell_type": "code",
|
26 |
+
"execution_count": 3,
|
27 |
"metadata": {},
|
28 |
"outputs": [],
|
29 |
"source": [
|
|
|
41 |
},
|
42 |
{
|
43 |
"cell_type": "code",
|
44 |
+
"execution_count": 4,
|
45 |
"metadata": {},
|
46 |
"outputs": [],
|
47 |
"source": [
|
|
|
50 |
},
|
51 |
{
|
52 |
"cell_type": "code",
|
53 |
+
"execution_count": 12,
|
54 |
"metadata": {},
|
55 |
"outputs": [],
|
56 |
"source": [
|
|
|
61 |
},
|
62 |
{
|
63 |
"cell_type": "code",
|
64 |
+
"execution_count": 13,
|
65 |
"metadata": {},
|
66 |
"outputs": [],
|
67 |
"source": [
|
68 |
+
"window_memory = ConversationBufferWindowMemory(k=3)"
|
69 |
]
|
70 |
},
|
71 |
{
|
72 |
"cell_type": "code",
|
73 |
+
"execution_count": 14,
|
74 |
"metadata": {},
|
75 |
"outputs": [],
|
76 |
"source": [
|
|
|
83 |
},
|
84 |
{
|
85 |
"cell_type": "code",
|
86 |
+
"execution_count": 15,
|
87 |
"metadata": {},
|
88 |
"outputs": [
|
89 |
{
|
|
|
97 |
"\u001b[32;1m\u001b[1;3mThe following is a friendly conversation between a human and an AI. The AI is talkative and provides lots of specific details from its context. If the AI does not know the answer to a question, it truthfully says it does not know.\n",
|
98 |
"\n",
|
99 |
"Current conversation:\n",
|
100 |
+
"\n",
|
101 |
+
"Human: Te amo. Sueña con nosotros\n",
|
|
|
|
|
|
|
102 |
"AI:\u001b[0m\n",
|
103 |
"\n",
|
104 |
"\u001b[1m> Finished chain.\u001b[0m\n"
|
|
|
107 |
{
|
108 |
"data": {
|
109 |
"text/plain": [
|
110 |
+
"' Te amo más. Sueña conmigo'"
|
111 |
]
|
112 |
},
|
113 |
+
"execution_count": 15,
|
114 |
"metadata": {},
|
115 |
"output_type": "execute_result"
|
116 |
}
|
|
|
122 |
},
|
123 |
{
|
124 |
"cell_type": "code",
|
125 |
+
"execution_count": 16,
|
126 |
"metadata": {},
|
127 |
"outputs": [
|
128 |
{
|
129 |
"name": "stdout",
|
130 |
"output_type": "stream",
|
131 |
"text": [
|
132 |
+
"Human: Te amo. Sueña con nosotros\n",
|
133 |
+
"AI: Te amo más. Sueña conmigo\n"
|
|
|
|
|
|
|
|
|
134 |
]
|
135 |
}
|
136 |
],
|
137 |
"source": [
|
138 |
"print(conversation.memory.buffer)"
|
139 |
]
|
140 |
+
},
|
141 |
+
{
|
142 |
+
"cell_type": "code",
|
143 |
+
"execution_count": null,
|
144 |
+
"metadata": {},
|
145 |
+
"outputs": [],
|
146 |
+
"source": []
|
147 |
}
|
148 |
],
|
149 |
"metadata": {
|