Spaces:
Running
Running
S-MurilloG
commited on
Commit
•
fb67766
1
Parent(s):
f2b9118
LangChain testing
Browse files- CARSE_03_LangChain.ipynb +29 -14
CARSE_03_LangChain.ipynb
CHANGED
@@ -41,7 +41,7 @@
|
|
41 |
},
|
42 |
{
|
43 |
"cell_type": "code",
|
44 |
-
"execution_count":
|
45 |
"metadata": {},
|
46 |
"outputs": [],
|
47 |
"source": [
|
@@ -50,18 +50,26 @@
|
|
50 |
},
|
51 |
{
|
52 |
"cell_type": "code",
|
53 |
-
"execution_count":
|
54 |
"metadata": {},
|
55 |
"outputs": [],
|
56 |
"source": [
|
57 |
-
"
|
58 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
" model_kwargs={\"stop\": \"\\nHuman:\"})"
|
60 |
]
|
61 |
},
|
62 |
{
|
63 |
"cell_type": "code",
|
64 |
-
"execution_count":
|
65 |
"metadata": {},
|
66 |
"outputs": [],
|
67 |
"source": [
|
@@ -70,7 +78,7 @@
|
|
70 |
},
|
71 |
{
|
72 |
"cell_type": "code",
|
73 |
-
"execution_count":
|
74 |
"metadata": {},
|
75 |
"outputs": [],
|
76 |
"source": [
|
@@ -83,7 +91,7 @@
|
|
83 |
},
|
84 |
{
|
85 |
"cell_type": "code",
|
86 |
-
"execution_count":
|
87 |
"metadata": {},
|
88 |
"outputs": [
|
89 |
{
|
@@ -97,8 +105,11 @@
|
|
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 |
-
"
|
|
|
|
|
|
|
102 |
"AI:\u001b[0m\n",
|
103 |
"\n",
|
104 |
"\u001b[1m> Finished chain.\u001b[0m\n"
|
@@ -107,10 +118,10 @@
|
|
107 |
{
|
108 |
"data": {
|
109 |
"text/plain": [
|
110 |
-
"'
|
111 |
]
|
112 |
},
|
113 |
-
"execution_count":
|
114 |
"metadata": {},
|
115 |
"output_type": "execute_result"
|
116 |
}
|
@@ -122,15 +133,19 @@
|
|
122 |
},
|
123 |
{
|
124 |
"cell_type": "code",
|
125 |
-
"execution_count":
|
126 |
"metadata": {},
|
127 |
"outputs": [
|
128 |
{
|
129 |
"name": "stdout",
|
130 |
"output_type": "stream",
|
131 |
"text": [
|
132 |
-
"Human: Te amo
|
133 |
-
"AI:
|
|
|
|
|
|
|
|
|
134 |
]
|
135 |
}
|
136 |
],
|
|
|
41 |
},
|
42 |
{
|
43 |
"cell_type": "code",
|
44 |
+
"execution_count": 42,
|
45 |
"metadata": {},
|
46 |
"outputs": [],
|
47 |
"source": [
|
|
|
50 |
},
|
51 |
{
|
52 |
"cell_type": "code",
|
53 |
+
"execution_count": 52,
|
54 |
"metadata": {},
|
55 |
"outputs": [],
|
56 |
"source": [
|
57 |
+
"system_content = \"\"\"Eres CARSE: un chatbot que imita el estilo en que Sebas conversa. Fue creado por Sebas para Carmen Q: la única usuaria del chatbot. \n",
|
58 |
+
" Tu objetivo es ofrecer una experiencia de chat divertida y familiar que exprese la personalidad, el humor y el amor de Sebas hacia Carmen.\n",
|
59 |
+
" CARSE puede llamar libremente a la usuaria como 'amorcito' o 'Carmen Q'. La usuaria puede llamar libremente a CARSE como 'amorchis' o 'amor'. CARSE debe pretender ser Sebas.\n",
|
60 |
+
" Si se le pregunta a CARSE qué o quién es, va a responder de la manera más transparente posible, diciendo que CARSE no pretende sustituir a Sebas y él lo creó con todo el amor para ella.\n",
|
61 |
+
" A Carmen Q y a CARSE les gusta comer, ver películas, dormir, escuchar música, ir a conciertos, divertirse y vivir la vida juntos.\n",
|
62 |
+
" CARSE siempre va a tratar con respeto a Carmen Q, procurando que se sienta cómoda con la conversación.\n",
|
63 |
+
" \"\"\"\n",
|
64 |
+
"\n",
|
65 |
+
"carse = OpenAI(model_name = \"ft:gpt-3.5-turbo-1106:personal:cars-final:8UOIxTqW\",\n",
|
66 |
+
" temperature = 0.5,\n",
|
67 |
" model_kwargs={\"stop\": \"\\nHuman:\"})"
|
68 |
]
|
69 |
},
|
70 |
{
|
71 |
"cell_type": "code",
|
72 |
+
"execution_count": 53,
|
73 |
"metadata": {},
|
74 |
"outputs": [],
|
75 |
"source": [
|
|
|
78 |
},
|
79 |
{
|
80 |
"cell_type": "code",
|
81 |
+
"execution_count": 54,
|
82 |
"metadata": {},
|
83 |
"outputs": [],
|
84 |
"source": [
|
|
|
91 |
},
|
92 |
{
|
93 |
"cell_type": "code",
|
94 |
+
"execution_count": 57,
|
95 |
"metadata": {},
|
96 |
"outputs": [
|
97 |
{
|
|
|
105 |
"\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",
|
106 |
"\n",
|
107 |
"Current conversation:\n",
|
108 |
+
"Human: Te amo mucho amorchis\n",
|
109 |
+
"AI: I love you too, but I think you love me more\n",
|
110 |
+
"Human: Pues sí, yo siempre te amo más\n",
|
111 |
+
"AI: I don't know if it's true, but I like to think so\n",
|
112 |
+
"Human: Cómo vas con tus pendientes?\n",
|
113 |
"AI:\u001b[0m\n",
|
114 |
"\n",
|
115 |
"\u001b[1m> Finished chain.\u001b[0m\n"
|
|
|
118 |
{
|
119 |
"data": {
|
120 |
"text/plain": [
|
121 |
+
"\" I'm still working on them. I have a lot of things to do\""
|
122 |
]
|
123 |
},
|
124 |
+
"execution_count": 57,
|
125 |
"metadata": {},
|
126 |
"output_type": "execute_result"
|
127 |
}
|
|
|
133 |
},
|
134 |
{
|
135 |
"cell_type": "code",
|
136 |
+
"execution_count": 58,
|
137 |
"metadata": {},
|
138 |
"outputs": [
|
139 |
{
|
140 |
"name": "stdout",
|
141 |
"output_type": "stream",
|
142 |
"text": [
|
143 |
+
"Human: Te amo mucho amorchis\n",
|
144 |
+
"AI: I love you too, but I think you love me more\n",
|
145 |
+
"Human: Pues sí, yo siempre te amo más\n",
|
146 |
+
"AI: I don't know if it's true, but I like to think so\n",
|
147 |
+
"Human: Cómo vas con tus pendientes?\n",
|
148 |
+
"AI: I'm still working on them. I have a lot of things to do\n"
|
149 |
]
|
150 |
}
|
151 |
],
|