crscardellino commited on
Commit
c043657
1 Parent(s): 6e3b9cf

Initial commit

Browse files
.gitattributes CHANGED
@@ -32,3 +32,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
32
  *.zip filter=lfs diff=lfs merge=lfs -text
33
  *.zst filter=lfs diff=lfs merge=lfs -text
34
  *tfevents* filter=lfs diff=lfs merge=lfs -text
35
+ *.gif filter=lfs diff=lfs merge=lfs -text
36
+ *.jpg filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,162 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # poetry
98
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
102
+ #poetry.lock
103
+
104
+ # pdm
105
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
106
+ #pdm.lock
107
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
108
+ # in version control.
109
+ # https://pdm.fming.dev/#use-with-ide
110
+ .pdm.toml
111
+
112
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
113
+ __pypackages__/
114
+
115
+ # Celery stuff
116
+ celerybeat-schedule
117
+ celerybeat.pid
118
+
119
+ # SageMath parsed files
120
+ *.sage.py
121
+
122
+ # Environments
123
+ .env
124
+ .venv
125
+ env/
126
+ venv/
127
+ ENV/
128
+ env.bak/
129
+ venv.bak/
130
+
131
+ # Spyder project settings
132
+ .spyderproject
133
+ .spyproject
134
+
135
+ # Rope project settings
136
+ .ropeproject
137
+
138
+ # mkdocs documentation
139
+ /site
140
+
141
+ # mypy
142
+ .mypy_cache/
143
+ .dmypy.json
144
+ dmypy.json
145
+
146
+ # Pyre type checker
147
+ .pyre/
148
+
149
+ # pytype static type analyzer
150
+ .pytype/
151
+
152
+ # Cython debug symbols
153
+ cython_debug/
154
+
155
+ # PyCharm
156
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
157
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
158
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
159
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
+ #.idea/
161
+
162
+ .vscode/
LICENSE ADDED
@@ -0,0 +1,674 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+ Preamble
9
+
10
+ The GNU General Public License is a free, copyleft license for
11
+ software and other kinds of works.
12
+
13
+ The licenses for most software and other practical works are designed
14
+ to take away your freedom to share and change the works. By contrast,
15
+ the GNU General Public License is intended to guarantee your freedom to
16
+ share and change all versions of a program--to make sure it remains free
17
+ software for all its users. We, the Free Software Foundation, use the
18
+ GNU General Public License for most of our software; it applies also to
19
+ any other work released this way by its authors. You can apply it to
20
+ your programs, too.
21
+
22
+ When we speak of free software, we are referring to freedom, not
23
+ price. Our General Public Licenses are designed to make sure that you
24
+ have the freedom to distribute copies of free software (and charge for
25
+ them if you wish), that you receive source code or can get it if you
26
+ want it, that you can change the software or use pieces of it in new
27
+ free programs, and that you know you can do these things.
28
+
29
+ To protect your rights, we need to prevent others from denying you
30
+ these rights or asking you to surrender the rights. Therefore, you have
31
+ certain responsibilities if you distribute copies of the software, or if
32
+ you modify it: responsibilities to respect the freedom of others.
33
+
34
+ For example, if you distribute copies of such a program, whether
35
+ gratis or for a fee, you must pass on to the recipients the same
36
+ freedoms that you received. You must make sure that they, too, receive
37
+ or can get the source code. And you must show them these terms so they
38
+ know their rights.
39
+
40
+ Developers that use the GNU GPL protect your rights with two steps:
41
+ (1) assert copyright on the software, and (2) offer you this License
42
+ giving you legal permission to copy, distribute and/or modify it.
43
+
44
+ For the developers' and authors' protection, the GPL clearly explains
45
+ that there is no warranty for this free software. For both users' and
46
+ authors' sake, the GPL requires that modified versions be marked as
47
+ changed, so that their problems will not be attributed erroneously to
48
+ authors of previous versions.
49
+
50
+ Some devices are designed to deny users access to install or run
51
+ modified versions of the software inside them, although the manufacturer
52
+ can do so. This is fundamentally incompatible with the aim of
53
+ protecting users' freedom to change the software. The systematic
54
+ pattern of such abuse occurs in the area of products for individuals to
55
+ use, which is precisely where it is most unacceptable. Therefore, we
56
+ have designed this version of the GPL to prohibit the practice for those
57
+ products. If such problems arise substantially in other domains, we
58
+ stand ready to extend this provision to those domains in future versions
59
+ of the GPL, as needed to protect the freedom of users.
60
+
61
+ Finally, every program is threatened constantly by software patents.
62
+ States should not allow patents to restrict development and use of
63
+ software on general-purpose computers, but in those that do, we wish to
64
+ avoid the special danger that patents applied to a free program could
65
+ make it effectively proprietary. To prevent this, the GPL assures that
66
+ patents cannot be used to render the program non-free.
67
+
68
+ The precise terms and conditions for copying, distribution and
69
+ modification follow.
70
+
71
+ TERMS AND CONDITIONS
72
+
73
+ 0. Definitions.
74
+
75
+ "This License" refers to version 3 of the GNU General Public License.
76
+
77
+ "Copyright" also means copyright-like laws that apply to other kinds of
78
+ works, such as semiconductor masks.
79
+
80
+ "The Program" refers to any copyrightable work licensed under this
81
+ License. Each licensee is addressed as "you". "Licensees" and
82
+ "recipients" may be individuals or organizations.
83
+
84
+ To "modify" a work means to copy from or adapt all or part of the work
85
+ in a fashion requiring copyright permission, other than the making of an
86
+ exact copy. The resulting work is called a "modified version" of the
87
+ earlier work or a work "based on" the earlier work.
88
+
89
+ A "covered work" means either the unmodified Program or a work based
90
+ on the Program.
91
+
92
+ To "propagate" a work means to do anything with it that, without
93
+ permission, would make you directly or secondarily liable for
94
+ infringement under applicable copyright law, except executing it on a
95
+ computer or modifying a private copy. Propagation includes copying,
96
+ distribution (with or without modification), making available to the
97
+ public, and in some countries other activities as well.
98
+
99
+ To "convey" a work means any kind of propagation that enables other
100
+ parties to make or receive copies. Mere interaction with a user through
101
+ a computer network, with no transfer of a copy, is not conveying.
102
+
103
+ An interactive user interface displays "Appropriate Legal Notices"
104
+ to the extent that it includes a convenient and prominently visible
105
+ feature that (1) displays an appropriate copyright notice, and (2)
106
+ tells the user that there is no warranty for the work (except to the
107
+ extent that warranties are provided), that licensees may convey the
108
+ work under this License, and how to view a copy of this License. If
109
+ the interface presents a list of user commands or options, such as a
110
+ menu, a prominent item in the list meets this criterion.
111
+
112
+ 1. Source Code.
113
+
114
+ The "source code" for a work means the preferred form of the work
115
+ for making modifications to it. "Object code" means any non-source
116
+ form of a work.
117
+
118
+ A "Standard Interface" means an interface that either is an official
119
+ standard defined by a recognized standards body, or, in the case of
120
+ interfaces specified for a particular programming language, one that
121
+ is widely used among developers working in that language.
122
+
123
+ The "System Libraries" of an executable work include anything, other
124
+ than the work as a whole, that (a) is included in the normal form of
125
+ packaging a Major Component, but which is not part of that Major
126
+ Component, and (b) serves only to enable use of the work with that
127
+ Major Component, or to implement a Standard Interface for which an
128
+ implementation is available to the public in source code form. A
129
+ "Major Component", in this context, means a major essential component
130
+ (kernel, window system, and so on) of the specific operating system
131
+ (if any) on which the executable work runs, or a compiler used to
132
+ produce the work, or an object code interpreter used to run it.
133
+
134
+ The "Corresponding Source" for a work in object code form means all
135
+ the source code needed to generate, install, and (for an executable
136
+ work) run the object code and to modify the work, including scripts to
137
+ control those activities. However, it does not include the work's
138
+ System Libraries, or general-purpose tools or generally available free
139
+ programs which are used unmodified in performing those activities but
140
+ which are not part of the work. For example, Corresponding Source
141
+ includes interface definition files associated with source files for
142
+ the work, and the source code for shared libraries and dynamically
143
+ linked subprograms that the work is specifically designed to require,
144
+ such as by intimate data communication or control flow between those
145
+ subprograms and other parts of the work.
146
+
147
+ The Corresponding Source need not include anything that users
148
+ can regenerate automatically from other parts of the Corresponding
149
+ Source.
150
+
151
+ The Corresponding Source for a work in source code form is that
152
+ same work.
153
+
154
+ 2. Basic Permissions.
155
+
156
+ All rights granted under this License are granted for the term of
157
+ copyright on the Program, and are irrevocable provided the stated
158
+ conditions are met. This License explicitly affirms your unlimited
159
+ permission to run the unmodified Program. The output from running a
160
+ covered work is covered by this License only if the output, given its
161
+ content, constitutes a covered work. This License acknowledges your
162
+ rights of fair use or other equivalent, as provided by copyright law.
163
+
164
+ You may make, run and propagate covered works that you do not
165
+ convey, without conditions so long as your license otherwise remains
166
+ in force. You may convey covered works to others for the sole purpose
167
+ of having them make modifications exclusively for you, or provide you
168
+ with facilities for running those works, provided that you comply with
169
+ the terms of this License in conveying all material for which you do
170
+ not control copyright. Those thus making or running the covered works
171
+ for you must do so exclusively on your behalf, under your direction
172
+ and control, on terms that prohibit them from making any copies of
173
+ your copyrighted material outside their relationship with you.
174
+
175
+ Conveying under any other circumstances is permitted solely under
176
+ the conditions stated below. Sublicensing is not allowed; section 10
177
+ makes it unnecessary.
178
+
179
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180
+
181
+ No covered work shall be deemed part of an effective technological
182
+ measure under any applicable law fulfilling obligations under article
183
+ 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184
+ similar laws prohibiting or restricting circumvention of such
185
+ measures.
186
+
187
+ When you convey a covered work, you waive any legal power to forbid
188
+ circumvention of technological measures to the extent such circumvention
189
+ is effected by exercising rights under this License with respect to
190
+ the covered work, and you disclaim any intention to limit operation or
191
+ modification of the work as a means of enforcing, against the work's
192
+ users, your or third parties' legal rights to forbid circumvention of
193
+ technological measures.
194
+
195
+ 4. Conveying Verbatim Copies.
196
+
197
+ You may convey verbatim copies of the Program's source code as you
198
+ receive it, in any medium, provided that you conspicuously and
199
+ appropriately publish on each copy an appropriate copyright notice;
200
+ keep intact all notices stating that this License and any
201
+ non-permissive terms added in accord with section 7 apply to the code;
202
+ keep intact all notices of the absence of any warranty; and give all
203
+ recipients a copy of this License along with the Program.
204
+
205
+ You may charge any price or no price for each copy that you convey,
206
+ and you may offer support or warranty protection for a fee.
207
+
208
+ 5. Conveying Modified Source Versions.
209
+
210
+ You may convey a work based on the Program, or the modifications to
211
+ produce it from the Program, in the form of source code under the
212
+ terms of section 4, provided that you also meet all of these conditions:
213
+
214
+ a) The work must carry prominent notices stating that you modified
215
+ it, and giving a relevant date.
216
+
217
+ b) The work must carry prominent notices stating that it is
218
+ released under this License and any conditions added under section
219
+ 7. This requirement modifies the requirement in section 4 to
220
+ "keep intact all notices".
221
+
222
+ c) You must license the entire work, as a whole, under this
223
+ License to anyone who comes into possession of a copy. This
224
+ License will therefore apply, along with any applicable section 7
225
+ additional terms, to the whole of the work, and all its parts,
226
+ regardless of how they are packaged. This License gives no
227
+ permission to license the work in any other way, but it does not
228
+ invalidate such permission if you have separately received it.
229
+
230
+ d) If the work has interactive user interfaces, each must display
231
+ Appropriate Legal Notices; however, if the Program has interactive
232
+ interfaces that do not display Appropriate Legal Notices, your
233
+ work need not make them do so.
234
+
235
+ A compilation of a covered work with other separate and independent
236
+ works, which are not by their nature extensions of the covered work,
237
+ and which are not combined with it such as to form a larger program,
238
+ in or on a volume of a storage or distribution medium, is called an
239
+ "aggregate" if the compilation and its resulting copyright are not
240
+ used to limit the access or legal rights of the compilation's users
241
+ beyond what the individual works permit. Inclusion of a covered work
242
+ in an aggregate does not cause this License to apply to the other
243
+ parts of the aggregate.
244
+
245
+ 6. Conveying Non-Source Forms.
246
+
247
+ You may convey a covered work in object code form under the terms
248
+ of sections 4 and 5, provided that you also convey the
249
+ machine-readable Corresponding Source under the terms of this License,
250
+ in one of these ways:
251
+
252
+ a) Convey the object code in, or embodied in, a physical product
253
+ (including a physical distribution medium), accompanied by the
254
+ Corresponding Source fixed on a durable physical medium
255
+ customarily used for software interchange.
256
+
257
+ b) Convey the object code in, or embodied in, a physical product
258
+ (including a physical distribution medium), accompanied by a
259
+ written offer, valid for at least three years and valid for as
260
+ long as you offer spare parts or customer support for that product
261
+ model, to give anyone who possesses the object code either (1) a
262
+ copy of the Corresponding Source for all the software in the
263
+ product that is covered by this License, on a durable physical
264
+ medium customarily used for software interchange, for a price no
265
+ more than your reasonable cost of physically performing this
266
+ conveying of source, or (2) access to copy the
267
+ Corresponding Source from a network server at no charge.
268
+
269
+ c) Convey individual copies of the object code with a copy of the
270
+ written offer to provide the Corresponding Source. This
271
+ alternative is allowed only occasionally and noncommercially, and
272
+ only if you received the object code with such an offer, in accord
273
+ with subsection 6b.
274
+
275
+ d) Convey the object code by offering access from a designated
276
+ place (gratis or for a charge), and offer equivalent access to the
277
+ Corresponding Source in the same way through the same place at no
278
+ further charge. You need not require recipients to copy the
279
+ Corresponding Source along with the object code. If the place to
280
+ copy the object code is a network server, the Corresponding Source
281
+ may be on a different server (operated by you or a third party)
282
+ that supports equivalent copying facilities, provided you maintain
283
+ clear directions next to the object code saying where to find the
284
+ Corresponding Source. Regardless of what server hosts the
285
+ Corresponding Source, you remain obligated to ensure that it is
286
+ available for as long as needed to satisfy these requirements.
287
+
288
+ e) Convey the object code using peer-to-peer transmission, provided
289
+ you inform other peers where the object code and Corresponding
290
+ Source of the work are being offered to the general public at no
291
+ charge under subsection 6d.
292
+
293
+ A separable portion of the object code, whose source code is excluded
294
+ from the Corresponding Source as a System Library, need not be
295
+ included in conveying the object code work.
296
+
297
+ A "User Product" is either (1) a "consumer product", which means any
298
+ tangible personal property which is normally used for personal, family,
299
+ or household purposes, or (2) anything designed or sold for incorporation
300
+ into a dwelling. In determining whether a product is a consumer product,
301
+ doubtful cases shall be resolved in favor of coverage. For a particular
302
+ product received by a particular user, "normally used" refers to a
303
+ typical or common use of that class of product, regardless of the status
304
+ of the particular user or of the way in which the particular user
305
+ actually uses, or expects or is expected to use, the product. A product
306
+ is a consumer product regardless of whether the product has substantial
307
+ commercial, industrial or non-consumer uses, unless such uses represent
308
+ the only significant mode of use of the product.
309
+
310
+ "Installation Information" for a User Product means any methods,
311
+ procedures, authorization keys, or other information required to install
312
+ and execute modified versions of a covered work in that User Product from
313
+ a modified version of its Corresponding Source. The information must
314
+ suffice to ensure that the continued functioning of the modified object
315
+ code is in no case prevented or interfered with solely because
316
+ modification has been made.
317
+
318
+ If you convey an object code work under this section in, or with, or
319
+ specifically for use in, a User Product, and the conveying occurs as
320
+ part of a transaction in which the right of possession and use of the
321
+ User Product is transferred to the recipient in perpetuity or for a
322
+ fixed term (regardless of how the transaction is characterized), the
323
+ Corresponding Source conveyed under this section must be accompanied
324
+ by the Installation Information. But this requirement does not apply
325
+ if neither you nor any third party retains the ability to install
326
+ modified object code on the User Product (for example, the work has
327
+ been installed in ROM).
328
+
329
+ The requirement to provide Installation Information does not include a
330
+ requirement to continue to provide support service, warranty, or updates
331
+ for a work that has been modified or installed by the recipient, or for
332
+ the User Product in which it has been modified or installed. Access to a
333
+ network may be denied when the modification itself materially and
334
+ adversely affects the operation of the network or violates the rules and
335
+ protocols for communication across the network.
336
+
337
+ Corresponding Source conveyed, and Installation Information provided,
338
+ in accord with this section must be in a format that is publicly
339
+ documented (and with an implementation available to the public in
340
+ source code form), and must require no special password or key for
341
+ unpacking, reading or copying.
342
+
343
+ 7. Additional Terms.
344
+
345
+ "Additional permissions" are terms that supplement the terms of this
346
+ License by making exceptions from one or more of its conditions.
347
+ Additional permissions that are applicable to the entire Program shall
348
+ be treated as though they were included in this License, to the extent
349
+ that they are valid under applicable law. If additional permissions
350
+ apply only to part of the Program, that part may be used separately
351
+ under those permissions, but the entire Program remains governed by
352
+ this License without regard to the additional permissions.
353
+
354
+ When you convey a copy of a covered work, you may at your option
355
+ remove any additional permissions from that copy, or from any part of
356
+ it. (Additional permissions may be written to require their own
357
+ removal in certain cases when you modify the work.) You may place
358
+ additional permissions on material, added by you to a covered work,
359
+ for which you have or can give appropriate copyright permission.
360
+
361
+ Notwithstanding any other provision of this License, for material you
362
+ add to a covered work, you may (if authorized by the copyright holders of
363
+ that material) supplement the terms of this License with terms:
364
+
365
+ a) Disclaiming warranty or limiting liability differently from the
366
+ terms of sections 15 and 16 of this License; or
367
+
368
+ b) Requiring preservation of specified reasonable legal notices or
369
+ author attributions in that material or in the Appropriate Legal
370
+ Notices displayed by works containing it; or
371
+
372
+ c) Prohibiting misrepresentation of the origin of that material, or
373
+ requiring that modified versions of such material be marked in
374
+ reasonable ways as different from the original version; or
375
+
376
+ d) Limiting the use for publicity purposes of names of licensors or
377
+ authors of the material; or
378
+
379
+ e) Declining to grant rights under trademark law for use of some
380
+ trade names, trademarks, or service marks; or
381
+
382
+ f) Requiring indemnification of licensors and authors of that
383
+ material by anyone who conveys the material (or modified versions of
384
+ it) with contractual assumptions of liability to the recipient, for
385
+ any liability that these contractual assumptions directly impose on
386
+ those licensors and authors.
387
+
388
+ All other non-permissive additional terms are considered "further
389
+ restrictions" within the meaning of section 10. If the Program as you
390
+ received it, or any part of it, contains a notice stating that it is
391
+ governed by this License along with a term that is a further
392
+ restriction, you may remove that term. If a license document contains
393
+ a further restriction but permits relicensing or conveying under this
394
+ License, you may add to a covered work material governed by the terms
395
+ of that license document, provided that the further restriction does
396
+ not survive such relicensing or conveying.
397
+
398
+ If you add terms to a covered work in accord with this section, you
399
+ must place, in the relevant source files, a statement of the
400
+ additional terms that apply to those files, or a notice indicating
401
+ where to find the applicable terms.
402
+
403
+ Additional terms, permissive or non-permissive, may be stated in the
404
+ form of a separately written license, or stated as exceptions;
405
+ the above requirements apply either way.
406
+
407
+ 8. Termination.
408
+
409
+ You may not propagate or modify a covered work except as expressly
410
+ provided under this License. Any attempt otherwise to propagate or
411
+ modify it is void, and will automatically terminate your rights under
412
+ this License (including any patent licenses granted under the third
413
+ paragraph of section 11).
414
+
415
+ However, if you cease all violation of this License, then your
416
+ license from a particular copyright holder is reinstated (a)
417
+ provisionally, unless and until the copyright holder explicitly and
418
+ finally terminates your license, and (b) permanently, if the copyright
419
+ holder fails to notify you of the violation by some reasonable means
420
+ prior to 60 days after the cessation.
421
+
422
+ Moreover, your license from a particular copyright holder is
423
+ reinstated permanently if the copyright holder notifies you of the
424
+ violation by some reasonable means, this is the first time you have
425
+ received notice of violation of this License (for any work) from that
426
+ copyright holder, and you cure the violation prior to 30 days after
427
+ your receipt of the notice.
428
+
429
+ Termination of your rights under this section does not terminate the
430
+ licenses of parties who have received copies or rights from you under
431
+ this License. If your rights have been terminated and not permanently
432
+ reinstated, you do not qualify to receive new licenses for the same
433
+ material under section 10.
434
+
435
+ 9. Acceptance Not Required for Having Copies.
436
+
437
+ You are not required to accept this License in order to receive or
438
+ run a copy of the Program. Ancillary propagation of a covered work
439
+ occurring solely as a consequence of using peer-to-peer transmission
440
+ to receive a copy likewise does not require acceptance. However,
441
+ nothing other than this License grants you permission to propagate or
442
+ modify any covered work. These actions infringe copyright if you do
443
+ not accept this License. Therefore, by modifying or propagating a
444
+ covered work, you indicate your acceptance of this License to do so.
445
+
446
+ 10. Automatic Licensing of Downstream Recipients.
447
+
448
+ Each time you convey a covered work, the recipient automatically
449
+ receives a license from the original licensors, to run, modify and
450
+ propagate that work, subject to this License. You are not responsible
451
+ for enforcing compliance by third parties with this License.
452
+
453
+ An "entity transaction" is a transaction transferring control of an
454
+ organization, or substantially all assets of one, or subdividing an
455
+ organization, or merging organizations. If propagation of a covered
456
+ work results from an entity transaction, each party to that
457
+ transaction who receives a copy of the work also receives whatever
458
+ licenses to the work the party's predecessor in interest had or could
459
+ give under the previous paragraph, plus a right to possession of the
460
+ Corresponding Source of the work from the predecessor in interest, if
461
+ the predecessor has it or can get it with reasonable efforts.
462
+
463
+ You may not impose any further restrictions on the exercise of the
464
+ rights granted or affirmed under this License. For example, you may
465
+ not impose a license fee, royalty, or other charge for exercise of
466
+ rights granted under this License, and you may not initiate litigation
467
+ (including a cross-claim or counterclaim in a lawsuit) alleging that
468
+ any patent claim is infringed by making, using, selling, offering for
469
+ sale, or importing the Program or any portion of it.
470
+
471
+ 11. Patents.
472
+
473
+ A "contributor" is a copyright holder who authorizes use under this
474
+ License of the Program or a work on which the Program is based. The
475
+ work thus licensed is called the contributor's "contributor version".
476
+
477
+ A contributor's "essential patent claims" are all patent claims
478
+ owned or controlled by the contributor, whether already acquired or
479
+ hereafter acquired, that would be infringed by some manner, permitted
480
+ by this License, of making, using, or selling its contributor version,
481
+ but do not include claims that would be infringed only as a
482
+ consequence of further modification of the contributor version. For
483
+ purposes of this definition, "control" includes the right to grant
484
+ patent sublicenses in a manner consistent with the requirements of
485
+ this License.
486
+
487
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
488
+ patent license under the contributor's essential patent claims, to
489
+ make, use, sell, offer for sale, import and otherwise run, modify and
490
+ propagate the contents of its contributor version.
491
+
492
+ In the following three paragraphs, a "patent license" is any express
493
+ agreement or commitment, however denominated, not to enforce a patent
494
+ (such as an express permission to practice a patent or covenant not to
495
+ sue for patent infringement). To "grant" such a patent license to a
496
+ party means to make such an agreement or commitment not to enforce a
497
+ patent against the party.
498
+
499
+ If you convey a covered work, knowingly relying on a patent license,
500
+ and the Corresponding Source of the work is not available for anyone
501
+ to copy, free of charge and under the terms of this License, through a
502
+ publicly available network server or other readily accessible means,
503
+ then you must either (1) cause the Corresponding Source to be so
504
+ available, or (2) arrange to deprive yourself of the benefit of the
505
+ patent license for this particular work, or (3) arrange, in a manner
506
+ consistent with the requirements of this License, to extend the patent
507
+ license to downstream recipients. "Knowingly relying" means you have
508
+ actual knowledge that, but for the patent license, your conveying the
509
+ covered work in a country, or your recipient's use of the covered work
510
+ in a country, would infringe one or more identifiable patents in that
511
+ country that you have reason to believe are valid.
512
+
513
+ If, pursuant to or in connection with a single transaction or
514
+ arrangement, you convey, or propagate by procuring conveyance of, a
515
+ covered work, and grant a patent license to some of the parties
516
+ receiving the covered work authorizing them to use, propagate, modify
517
+ or convey a specific copy of the covered work, then the patent license
518
+ you grant is automatically extended to all recipients of the covered
519
+ work and works based on it.
520
+
521
+ A patent license is "discriminatory" if it does not include within
522
+ the scope of its coverage, prohibits the exercise of, or is
523
+ conditioned on the non-exercise of one or more of the rights that are
524
+ specifically granted under this License. You may not convey a covered
525
+ work if you are a party to an arrangement with a third party that is
526
+ in the business of distributing software, under which you make payment
527
+ to the third party based on the extent of your activity of conveying
528
+ the work, and under which the third party grants, to any of the
529
+ parties who would receive the covered work from you, a discriminatory
530
+ patent license (a) in connection with copies of the covered work
531
+ conveyed by you (or copies made from those copies), or (b) primarily
532
+ for and in connection with specific products or compilations that
533
+ contain the covered work, unless you entered into that arrangement,
534
+ or that patent license was granted, prior to 28 March 2007.
535
+
536
+ Nothing in this License shall be construed as excluding or limiting
537
+ any implied license or other defenses to infringement that may
538
+ otherwise be available to you under applicable patent law.
539
+
540
+ 12. No Surrender of Others' Freedom.
541
+
542
+ If conditions are imposed on you (whether by court order, agreement or
543
+ otherwise) that contradict the conditions of this License, they do not
544
+ excuse you from the conditions of this License. If you cannot convey a
545
+ covered work so as to satisfy simultaneously your obligations under this
546
+ License and any other pertinent obligations, then as a consequence you may
547
+ not convey it at all. For example, if you agree to terms that obligate you
548
+ to collect a royalty for further conveying from those to whom you convey
549
+ the Program, the only way you could satisfy both those terms and this
550
+ License would be to refrain entirely from conveying the Program.
551
+
552
+ 13. Use with the GNU Affero General Public License.
553
+
554
+ Notwithstanding any other provision of this License, you have
555
+ permission to link or combine any covered work with a work licensed
556
+ under version 3 of the GNU Affero General Public License into a single
557
+ combined work, and to convey the resulting work. The terms of this
558
+ License will continue to apply to the part which is the covered work,
559
+ but the special requirements of the GNU Affero General Public License,
560
+ section 13, concerning interaction through a network will apply to the
561
+ combination as such.
562
+
563
+ 14. Revised Versions of this License.
564
+
565
+ The Free Software Foundation may publish revised and/or new versions of
566
+ the GNU General Public License from time to time. Such new versions will
567
+ be similar in spirit to the present version, but may differ in detail to
568
+ address new problems or concerns.
569
+
570
+ Each version is given a distinguishing version number. If the
571
+ Program specifies that a certain numbered version of the GNU General
572
+ Public License "or any later version" applies to it, you have the
573
+ option of following the terms and conditions either of that numbered
574
+ version or of any later version published by the Free Software
575
+ Foundation. If the Program does not specify a version number of the
576
+ GNU General Public License, you may choose any version ever published
577
+ by the Free Software Foundation.
578
+
579
+ If the Program specifies that a proxy can decide which future
580
+ versions of the GNU General Public License can be used, that proxy's
581
+ public statement of acceptance of a version permanently authorizes you
582
+ to choose that version for the Program.
583
+
584
+ Later license versions may give you additional or different
585
+ permissions. However, no additional obligations are imposed on any
586
+ author or copyright holder as a result of your choosing to follow a
587
+ later version.
588
+
589
+ 15. Disclaimer of Warranty.
590
+
591
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592
+ APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593
+ HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594
+ OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595
+ THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596
+ PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597
+ IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598
+ ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599
+
600
+ 16. Limitation of Liability.
601
+
602
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604
+ THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605
+ GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606
+ USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607
+ DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608
+ PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609
+ EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610
+ SUCH DAMAGES.
611
+
612
+ 17. Interpretation of Sections 15 and 16.
613
+
614
+ If the disclaimer of warranty and limitation of liability provided
615
+ above cannot be given local legal effect according to their terms,
616
+ reviewing courts shall apply local law that most closely approximates
617
+ an absolute waiver of all civil liability in connection with the
618
+ Program, unless a warranty or assumption of liability accompanies a
619
+ copy of the Program in return for a fee.
620
+
621
+ END OF TERMS AND CONDITIONS
622
+
623
+ How to Apply These Terms to Your New Programs
624
+
625
+ If you develop a new program, and you want it to be of the greatest
626
+ possible use to the public, the best way to achieve this is to make it
627
+ free software which everyone can redistribute and change under these terms.
628
+
629
+ To do so, attach the following notices to the program. It is safest
630
+ to attach them to the start of each source file to most effectively
631
+ state the exclusion of warranty; and each file should have at least
632
+ the "copyright" line and a pointer to where the full notice is found.
633
+
634
+ <one line to give the program's name and a brief idea of what it does.>
635
+ Copyright (C) <year> <name of author>
636
+
637
+ This program is free software: you can redistribute it and/or modify
638
+ it under the terms of the GNU General Public License as published by
639
+ the Free Software Foundation, either version 3 of the License, or
640
+ (at your option) any later version.
641
+
642
+ This program is distributed in the hope that it will be useful,
643
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
644
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645
+ GNU General Public License for more details.
646
+
647
+ You should have received a copy of the GNU General Public License
648
+ along with this program. If not, see <https://www.gnu.org/licenses/>.
649
+
650
+ Also add information on how to contact you by electronic and paper mail.
651
+
652
+ If the program does terminal interaction, make it output a short
653
+ notice like this when it starts in an interactive mode:
654
+
655
+ flisol-cba-martin-fierro Copyright (C) 2023 Cristian Cardellino
656
+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657
+ This is free software, and you are welcome to redistribute it
658
+ under certain conditions; type `show c' for details.
659
+
660
+ The hypothetical commands `show w' and `show c' should show the appropriate
661
+ parts of the General Public License. Of course, your program's commands
662
+ might be different; for a GUI interface, you would use an "about box".
663
+
664
+ You should also get your employer (if you work as a programmer) or school,
665
+ if any, to sign a "copyright disclaimer" for the program, if necessary.
666
+ For more information on this, and how to apply and follow the GNU GPL, see
667
+ <https://www.gnu.org/licenses/>.
668
+
669
+ The GNU General Public License does not permit incorporating your program
670
+ into proprietary programs. If your program is a subroutine library, you
671
+ may consider it more useful to permit linking proprietary applications with
672
+ the library. If this is what you want to do, use the GNU Lesser General
673
+ Public License instead of this License. But first, please read
674
+ <https://www.gnu.org/licenses/why-not-lgpl.html>.
README.md CHANGED
@@ -1,3 +1,94 @@
1
  ---
 
 
2
  license: gpl-3.0
 
 
 
 
 
 
 
 
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ language:
3
+ - es
4
  license: gpl-3.0
5
+ tags:
6
+ - generated_from_trainer
7
+ model-index:
8
+ - name: flisol-cba-martin-fierro
9
+ results: []
10
+ widget:
11
+ - text: "Aqui me pongo a cantar"
12
+ example_title: "Martin Fierro"
13
  ---
14
+
15
+ Hugging Face: IA Colaborativa
16
+ =============================
17
+
18
+ En este repositorio estará disponible el código y modelo que entrené para la
19
+ charla ["Hugging Face: IA Colaborativa"](https://eventol.flisol.org.ar/events/cordoba2023/activity/378/)
20
+ del [FLISoL de Córdoba](https://cordoba.flisol.org.ar), Argentina, de 2023.
21
+
22
+ Para inicializar el setup hace falta tener instalado y activado
23
+ [`git-lfs`](https://git-lfs.com/).
24
+
25
+ Pueden clonar el repositorio con:
26
+
27
+ $ git clone https://huggingface.co/crscardellino/flisol-cba-martin-fierro
28
+
29
+ Y luego crean el entorno e instalan los requerimientos.
30
+
31
+ $ python -m venv flisol-venv
32
+ $ source ./flisol-venv/bin/activate
33
+ (flisol-venv) $ pip install -r requirements.txt
34
+
35
+ El código está probado con Python 3.10, pero debería funcionar con Python >=
36
+ 3.8. En los requerimientos está organizado para instalar
37
+ [PyTorch](https://pytorch.org/) v2.0.0 para cpu, pero pueden ajustarlo para
38
+ utilizar GPUs suponiendo que cumplan los requerimientos de CUDA.
39
+
40
+ ## Model Specifications (Auto Generated)
41
+
42
+ This model is a fine-tuned version of
43
+ [DeepESP/gpt2-spanish](https://huggingface.co/DeepESP/gpt2-spanish) on the
44
+ `./data/martin-fierro_train.txt` dataset. It achieves the following results on
45
+ the evaluation set:
46
+
47
+ - Loss: 3.9067
48
+
49
+ ## Model description
50
+
51
+ GPT-2 model finetuned on the poem ["El Gaucho Martin
52
+ Fierro"](https://es.wikipedia.org/wiki/El_Gaucho_Mart%C3%ADn_Fierro)
53
+
54
+ ## Intended uses & limitations
55
+
56
+ This was trained for the talk ["Hugging Face: IA
57
+ Colaborativa"](https://eventol.flisol.org.ar/events/cordoba2023/activity/378/) @
58
+ [FLISoL de Córdoba](https://cordoba.flisol.org.ar), Argentina, 2023.
59
+
60
+ ## Training and evaluation data
61
+
62
+ ### Training hyperparameters
63
+
64
+ The following hyperparameters were used during training:
65
+ - learning_rate: 2e-05
66
+ - train_batch_size: 8
67
+ - eval_batch_size: 8
68
+ - seed: 42
69
+ - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
70
+ - lr_scheduler_type: linear
71
+ - num_epochs: 10
72
+
73
+ ### Training results
74
+
75
+ | Training Loss | Epoch | Step | Validation Loss |
76
+ |:-------------:|:-----:|:----:|:---------------:|
77
+ | 4.3864 | 1.0 | 18 | 4.2025 |
78
+ | 3.948 | 2.0 | 36 | 4.0440 |
79
+ | 3.7962 | 3.0 | 54 | 3.9804 |
80
+ | 3.6105 | 4.0 | 72 | 3.9458 |
81
+ | 3.4444 | 5.0 | 90 | 3.9280 |
82
+ | 3.3855 | 6.0 | 108 | 3.9192 |
83
+ | 3.3142 | 7.0 | 126 | 3.9091 |
84
+ | 3.2192 | 8.0 | 144 | 3.9074 |
85
+ | 3.1615 | 9.0 | 162 | 3.9070 |
86
+ | 3.1637 | 10.0 | 180 | 3.9067 |
87
+
88
+
89
+ ### Framework versions
90
+
91
+ - Transformers 4.28.1
92
+ - Pytorch 2.0.0+cpu
93
+ - Datasets 2.11.0
94
+ - Tokenizers 0.13.3
chatbot.py ADDED
@@ -0,0 +1,202 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Chatbot based on the notebook [How to generate text: using different decoding
3
+ methods for language generation with
4
+ Transformers](https://github.com/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb)
5
+ and the blog post [Create conversational agents using BLOOM:
6
+ Part-1](https://medium.com/@fractal.ai/create-conversational-agents-using-bloom-part-1-63a66e6321c0).
7
+
8
+ This code needs testing, as it is not fitted for a production model.
9
+
10
+ It's a very basic chatbot that uses Causal Language Models from Transformers
11
+ given an PROMPT.
12
+
13
+ An example of a basic PROMPT is given in the file `prompt.txt` for a Spanish
14
+ prompt.
15
+ """
16
+
17
+ import argparse
18
+ import torch
19
+
20
+ from transformers import AutoModelForCausalLM, AutoTokenizer, PreTrainedModel,\
21
+ PreTrainedTokenizerBase
22
+ from typing import Optional, Union
23
+
24
+
25
+ class ChatBot:
26
+ """
27
+ Main class wrapper around the transformers models in order to build a basic
28
+ chatbot application.
29
+
30
+ Parameters
31
+ ----------
32
+ base_model : str | PreTrainedModel
33
+ A name (path in hugging face hub) for a model, or the model itself.
34
+ tokenizer : PreTrainedTokenizerBase | None
35
+ Needed in case the base_model is a given model, otherwise it will load
36
+ the same model given by the base_model path.
37
+ initial_prompt : str
38
+ A prompt for the model. Should follow the example given in
39
+ `BASE_PROMPT`
40
+ keep_context : bool
41
+ Whether to accumulate the context as the chatbot is used.
42
+ creative : bool
43
+ Whether to generate text through sampling (with some very basic config)
44
+ or to go with greedy algorithm. Check the notebook "How to generate
45
+ text" (link above) for more information.
46
+ max_tokens : int
47
+ Max number of tokens to generate in the chat.
48
+ human_identifier : str
49
+ The string that will identify the human speaker in the prompt (e.g.
50
+ HUMAN).
51
+ bot_identifier : str
52
+ The string that will identify the bot speaker in the prompt (e.g.
53
+ EXPERT).
54
+ """
55
+
56
+ def __init__(self,
57
+ base_model: Union[str, PreTrainedModel],
58
+ tokenizer: Optional[PreTrainedTokenizerBase] = None,
59
+ initial_prompt: Optional[str] = None,
60
+ keep_context: bool = False,
61
+ creative: bool = False,
62
+ max_tokens: int = 50,
63
+ human_identifier: str = 'HUMAN',
64
+ bot_identifier: str = 'EXPERT'):
65
+ if isinstance(base_model, str):
66
+ self.model = AutoModelForCausalLM.from_pretrained(
67
+ base_model,
68
+ low_cpu_mem_usage=True,
69
+ torch_dtype='auto'
70
+ )
71
+ self.tokenizer = AutoTokenizer.from_pretrained(base_model)
72
+ else:
73
+ assert isinstance(tokenizer, PreTrainedTokenizerBase),\
74
+ "If the base model is given, the tokenizer should be given as well"
75
+ self.model = base_model
76
+ self.tokenizer = tokenizer
77
+
78
+ if initial_prompt is None:
79
+ with open('./prompt.txt', 'r') as fh:
80
+ self.initial_prompt = fh.read()
81
+ else:
82
+ self.initial_prompt = initial_prompt
83
+
84
+ self.keep_context = keep_context
85
+ self.context = ''
86
+ self.creative = creative
87
+ self.max_tokens = max_tokens
88
+ self.human_identifier = human_identifier
89
+ self.bot_identifier = bot_identifier
90
+
91
+ def chat(self, input_text: str) -> str:
92
+ """
93
+ Generates a response from the prompt (and optionally the context) where
94
+ it adds the `input_text` as if it was part of the HUMAN dialog
95
+ (identified by `self.human_identifier`), and prompts the bot
96
+ (identified by `self.bot_identifier`) for a response. As the bot might
97
+ continue the conversation beyond the scope, it trims the output so it
98
+ only shows the first dialog given by the bot, following the idea
99
+ presented in the Medium blog post for creating conversational agents
100
+ (link above).
101
+
102
+ Parameters
103
+ ----------
104
+ input_text : str
105
+ The question asked/phrase prompted by a human.
106
+
107
+ Returns
108
+ -------
109
+ str
110
+ The output given by the bot, trimmed for better control.
111
+ """
112
+ # Setup the prompt given the initial prompt and add the words that
113
+ # start the dialog between the human and the bot. Give space for the
114
+ # model to continue from the prompt
115
+ prompt = self.initial_prompt + self.context
116
+ prompt += f'{self.human_identifier}: {input_text}\n'
117
+ prompt += f'{self.bot_identifier}: ' # check the space after the colon
118
+
119
+ input_ids = self.tokenizer.encode(prompt, return_tensors='pt')
120
+ if self.creative:
121
+ # In case you want the bot to be creative, we sample using `top_k`
122
+ # and `top_p`
123
+ output = self.model.generate(
124
+ input_ids,
125
+ do_sample=True,
126
+ max_length=input_ids.shape[1] + self.max_tokens,
127
+ top_k=50,
128
+ top_p=0.95
129
+ )[0]
130
+ else:
131
+ # Otherwise we return the most probable token
132
+ output = self.model.generate(
133
+ input_ids,
134
+ max_length=input_ids.shape[1] + self.max_tokens
135
+ )[0]
136
+
137
+ # Decode the output, removing special tokens for the model (like
138
+ # `[CLS]` and similar)
139
+ decoded_output = self.tokenizer.decode(output, skip_special_tokens=True)
140
+
141
+ # Trim the output, first by removing the original prompt
142
+ trimmed_output = decoded_output[len(prompt):]
143
+
144
+ # Then we find the stop token, in this case the human identifier, and
145
+ # we get up to that point
146
+ trimmed_output = trimmed_output[:trimmed_output.find(f'{self.human_identifier}:')]
147
+
148
+ if self.keep_context:
149
+ # If we want to keep the context of the conversation we add the
150
+ # trimmed output so far
151
+ self.context += prompt + trimmed_output
152
+
153
+ return trimmed_output.strip() # we only return the trimmed output
154
+
155
+
156
+ if __name__ == '__main__':
157
+ parser = argparse.ArgumentParser()
158
+ parser.add_argument('--model-name', '-m',
159
+ default='bigscience/bloom-560m',
160
+ help="Name of the base model to use for the chatbot")
161
+ parser.add_argument('--prompt', '-p',
162
+ default='./prompt.txt',
163
+ help="Path to the file with the prompt to use")
164
+ parser.add_argument('--keep-context', '-k',
165
+ action='store_true',
166
+ help="Keep context of the conversation.")
167
+ parser.add_argument('--creative', '-c',
168
+ action='store_true',
169
+ help="Make the bot creative when answering.")
170
+ parser.add_argument('--random-seed', '-r',
171
+ default=42,
172
+ help="Seed number for the creative bot.",
173
+ type=int)
174
+ parser.add_argument('--human-identifier', '-i',
175
+ default='HUMANO',
176
+ help="Name of the human identifier.")
177
+ parser.add_argument('--bot-identifier', '-b',
178
+ default='EXPERTO',
179
+ help="Name of the bot identifier.")
180
+
181
+ args = parser.parse_args()
182
+
183
+ torch.manual_seed(args.random_seed)
184
+
185
+ with open(args.prompt, 'r') as fh:
186
+ initial_prompt = fh.read()
187
+
188
+ chatbot = ChatBot(
189
+ base_model=args.model_name,
190
+ initial_prompt=initial_prompt,
191
+ keep_context=args.keep_context,
192
+ creative=args.creative,
193
+ human_identifier=args.human_identifier,
194
+ bot_identifier=args.bot_identifier
195
+ )
196
+
197
+ print("Write `exit` or `quit` to quit")
198
+ while True:
199
+ input_text = input('> ')
200
+ if input_text == 'exit' or input_text == 'quit':
201
+ break
202
+ print(chatbot.chat(input_text))
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "DeepESP/gpt2-spanish",
3
+ "activation_function": "gelu_new",
4
+ "architectures": [
5
+ "GPT2LMHeadModel"
6
+ ],
7
+ "attn_pdrop": 0.1,
8
+ "bos_token_id": 50256,
9
+ "embd_pdrop": 0.1,
10
+ "eos_token_id": 50256,
11
+ "gradient_checkpointing": false,
12
+ "initializer_range": 0.02,
13
+ "layer_norm_epsilon": 1e-05,
14
+ "model_type": "gpt2",
15
+ "n_ctx": 1024,
16
+ "n_embd": 768,
17
+ "n_head": 12,
18
+ "n_inner": null,
19
+ "n_layer": 12,
20
+ "n_positions": 1024,
21
+ "reorder_and_upcast_attn": false,
22
+ "resid_pdrop": 0.1,
23
+ "scale_attn_by_inverse_layer_idx": false,
24
+ "scale_attn_weights": true,
25
+ "summary_activation": null,
26
+ "summary_first_dropout": 0.1,
27
+ "summary_proj_to_labels": true,
28
+ "summary_type": "cls_index",
29
+ "summary_use_proj": true,
30
+ "task_specific_params": {
31
+ "text-generation": {
32
+ "do_sample": true,
33
+ "max_length": 50
34
+ }
35
+ },
36
+ "torch_dtype": "float32",
37
+ "transformers_version": "4.28.1",
38
+ "use_cache": true,
39
+ "vocab_size": 50257
40
+ }
data/martin-fierro_train.txt ADDED
@@ -0,0 +1,2907 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ I - Cantor y Gaucho.
2
+
3
+ 1
4
+ Aquí me pongo a cantar
5
+ Al compás de la vigüela,
6
+ Que el hombre que lo desvela
7
+ Una pena estraordinaria
8
+ Como la ave solitaria
9
+ Con el cantar se consuela.
10
+
11
+ 2
12
+ Pido a los Santos del Cielo
13
+ Que ayuden mi pensamiento;
14
+ Les pido en este momento
15
+ Que voy a cantar mi historia
16
+ Me refresquen la memoria
17
+ Y aclaren mi entendimiento.
18
+
19
+ 3
20
+ Vengan Santos milagrosos,
21
+ Vengan todos en mi ayuda,
22
+ Que la lengua se me añuda
23
+ Y se me turba la vista;
24
+ Pido a Dios que me asista
25
+ En una ocasión tan ruda.
26
+
27
+ 4
28
+ Yo he visto muchos cantores,
29
+ Con famas bien obtenidas,
30
+ Y que después de adquiridas
31
+ No las quieren sustentar
32
+ Parece que sin largar
33
+ se cansaron en partidas
34
+
35
+ 5
36
+ Mas ande otro criollo pasa
37
+ Martín Fierro ha de pasar;
38
+ nada lo hace recular
39
+ ni los fantasmas lo espantan,
40
+ y dende que todos cantan
41
+ yo también quiero cantar.
42
+
43
+ 6
44
+ Cantando me he de morir
45
+ Cantando me han de enterrar,
46
+ Y cantando he de llegar
47
+ Al pie del eterno padre:
48
+ Dende el vientre de mi madre
49
+ Vine a este mundo a cantar.
50
+
51
+ 7
52
+ Que no se trabe mi lengua
53
+ Ni me falte la palabra:
54
+ El cantar mi gloria labra
55
+ Y poniéndome a cantar,
56
+ Cantando me han de encontrar
57
+ Aunque la tierra se abra.
58
+
59
+ 8
60
+ Me siento en el plan de un bajo
61
+ A cantar un argumento:
62
+ Como si soplara el viento
63
+ Hago tiritar los pastos;
64
+ Con oros, copas y bastos
65
+ Juega allí mi pensamiento.
66
+
67
+ 9
68
+ Yo no soy cantor letrao,
69
+ Mas si me pongo a cantar
70
+ No tengo cuándo acabar
71
+ Y me envejezco cantando:
72
+ Las coplas me van brotando
73
+ Como agua de manantial.
74
+
75
+ 10
76
+ Con la guitarra en la mano
77
+ Ni las moscas se me arriman,
78
+ Naides me pone el pie encima,
79
+ Y cuando el pecho se entona,
80
+ Hago gemir a la prima
81
+ Y llorar a la bordona.
82
+
83
+ 11
84
+ Yo soy toro en mi rodeo
85
+ Y torazo en rodeo ajeno;
86
+ Siempre me tuve por güeno
87
+ Y si me quieren probar,
88
+ Salgan otros a cantar
89
+ Y veremos quién es menos.
90
+
91
+ 12
92
+ No me hago al lao de la güeya
93
+ Aunque vengan degollando,
94
+ Con los blandos yo soy blando
95
+ Y soy duro con los duros,
96
+ Y ninguno en un apuro
97
+ Me ha visto andar tutubiando.
98
+
99
+ 13
100
+ En el peligro, ¡qué Cristos!
101
+ El corazón se me enancha,
102
+ Pues toda la tierra es cancha,
103
+ Y de eso naides se asombre:
104
+ El que se tiene por hombre
105
+ Ande quiere hace pata ancha.
106
+
107
+ 14
108
+ Soy gaucho, y entiendaló
109
+ Como mi lengua lo esplica:
110
+ Para mí la tierra es chica
111
+ Y pudiera ser mayor;
112
+ Ni la víbora me pica
113
+ Ni quema mi frente el sol
114
+
115
+ 15
116
+ Nací como nace el peje
117
+ En el fondo de la mar;
118
+ Naides me puede quitar
119
+ Aquello que Dios me dio
120
+ Lo que al mundo truje yo
121
+ Del mundo lo he de llevar.
122
+
123
+ 16
124
+ Mi gloria es vivir tan libre
125
+ Como el pájaro del cielo:
126
+ No hago nido en este suelo
127
+ Ande hay tanto que sufrir,
128
+ Y naides me ha de seguir
129
+ Cuando yo remuento el vuelo.
130
+
131
+ 17
132
+ Yo no tengo en el amor
133
+ Quien me venga con querellas;
134
+ Como esas aves tan bellas
135
+ Que saltan de rama en rama,
136
+ Yo hago en el trébol mi cama,
137
+ Y me cubren las estrellas.
138
+
139
+ 18
140
+ Y sepan cuantos escuchan
141
+ De mis penas el relato,
142
+ Que nunca peleo ni mato
143
+ Sino por necesidá,
144
+ Y que a tanta alversidá
145
+ Sólo me arrojó el mal trato
146
+
147
+ 19
148
+ Y atiendan la relación
149
+ que hace un gaucho perseguido,
150
+ que padre y marido ha sido
151
+ empeñoso y diligente,
152
+ y sin embargo la gente
153
+ lo tiene por un bandido
154
+
155
+
156
+ II - Ayer y hoy.
157
+
158
+ 20
159
+ Ninguno me hable de penas,
160
+ porque yo penado vivo,
161
+ y naides se muestre altivo
162
+ aunque en el estribo esté:
163
+ que suele quedarse a pie
164
+ el gaucho mas alvertido.
165
+
166
+ 21
167
+ Junta esperencia en la vida
168
+ hasta pa dar y prestar
169
+ quien la tiene que pasar
170
+ entre sufrimiento y llanto,
171
+ porque nada enseña tanto
172
+ como el sufrir y el llorar.
173
+
174
+ 22
175
+ Viene el hombre ciego al mundo,
176
+ cuartiándolo la esperanza,
177
+ y a poco andar ya lo alcanzan
178
+ las desgracias a empujones,
179
+ ¡la pucha, que trae liciones
180
+ el tiempo con sus mudanzas!
181
+
182
+ 23
183
+ Yo he conocido esta tierra
184
+ en que el paisano vivía
185
+ y su ranchito tenía
186
+ y sus hijos y mujer...
187
+ era una delicia el ver
188
+ como pasaba sus días.
189
+
190
+ 24
191
+ Entonces... cuando el lucero
192
+ brillaba en el cielo santo,
193
+ y los gallos con su canto
194
+ nos decían que el día llegaba,
195
+ a la cocina rumbiaba
196
+ el gaucho... que un encanto.
197
+
198
+ 25
199
+ Y sentao junto al jogón
200
+ a esperar que venga el día,
201
+ al cimarrón le prendía
202
+ hasta ponerse rechoncho,
203
+ mientras su china dormía
204
+ tapadita con su poncho.
205
+
206
+ 26
207
+ Y apenas la madrugada
208
+ empezaba coloriar,
209
+ los pájaros a cantar,
210
+ y las gallinas a apiarse,
211
+ era cosa de largarse
212
+ cada cual a trabajar.
213
+
214
+ 27
215
+ Este se ata las espuelas,
216
+ se sale el otro cantando,
217
+ uno busca un pellón blando,
218
+ este un lazo, otro un rebenque,
219
+ y los pingos relinchando
220
+ los llaman dende el palenque.
221
+
222
+ 28
223
+ El que era pion domador
224
+ enderezaba al corral,
225
+ ande estaba el animal
226
+ bufidos que se las pela...
227
+ y más malo que su agüela,
228
+ se hacia astillas el bagual.
229
+
230
+ 29
231
+ Y allí el gaucho inteligente,
232
+ en cuanto el potro enriendó,
233
+ los cueros le acomodó
234
+ y se le sentó en seguida,
235
+ que el hombre muestra en la vida
236
+ la astucia que Dios le dio.
237
+
238
+ 30
239
+ Y en las playas corcoviando
240
+ pedazos se hacía el sotreta
241
+ mientras él por las paletas
242
+ le jugaba las lloronas,
243
+ y al ruido de las caronas
244
+ salía haciendo gambetas.
245
+
246
+ 31
247
+ ¡Ah, tiempos!... ¡Si era un orgullo
248
+ ver jinetear un paisano!
249
+ Cuando era gaucho baquiano,
250
+ aunque el potro se boliase,
251
+ no había uno que no parese
252
+ con el cabresto en la mano.
253
+
254
+ 32
255
+ Y mientras domaban unos,
256
+ otros al campo salían
257
+ y la hacienda recogían,
258
+ las manadas repuntaban,
259
+ y ansí sin sentir pasaban
260
+ entretenidos el día.
261
+
262
+ 33
263
+ Y verlos al cair la tarde
264
+ en la cocina riunidos,
265
+ con el juego bien prendido
266
+ y mil cosas que contar,
267
+ platicar muy divertidos
268
+ hasta después de cenar.
269
+
270
+ 34
271
+ Y con el buche bien lleno
272
+ era cosa superior
273
+ irse en brazos del amor
274
+ a dormir como la gente,
275
+ pa empezar el día siguiente
276
+ las fainas del día anterior.
277
+
278
+ 35
279
+ Ricuerdo ¡qué maravilla!
280
+ Cómo andaba la gauchada
281
+ siempre alegre y bien montada
282
+ y dispuesta pa el trabajo...
283
+ pero hoy en día... ¡barajo!
284
+ No se la ve de aporriada.
285
+
286
+ 36
287
+ El gaucho más infeliz
288
+ tenía tropilla de un pelo,
289
+ no le faltaba un consuelo
290
+ y andaba la gente lista...
291
+ teniendo al campo la vista,
292
+ sólo vía hacienda y cielo.
293
+
294
+ 37
295
+ Cuando llegaban las yerras,
296
+ ¡cosa que daba calor!
297
+ Tanto gaucho pialador
298
+ y tironiador sin yel.
299
+ ¡Ah, tiempos... pero si en él
300
+ se ha visto tanto primor!
301
+
302
+ 38
303
+ Aquello no era trabajo,
304
+ mas bien era una junción,
305
+ y después de un güen tirón
306
+ en que uno se daba mana,
307
+ pa darle un trago de cana
308
+ solía llamarlo el patrón.
309
+
310
+ 39
311
+ Pues vivía la mamajuana
312
+ siempre bajo la carreta,
313
+ y aquel que no era chancleta,
314
+ en cuanto el goyete vía,
315
+ sin miedo se le prendía
316
+ como güérfano a la teta.
317
+
318
+ 40
319
+ ¡Y qué jugadas se armaban
320
+ cuando estábamos riunidos!
321
+ Siempre íbamos prevenidos,
322
+ pues en tales ocasiones
323
+ a ayudarle a los piones
324
+ caiban muchos comedidos.
325
+
326
+ 41
327
+ Eran los días del apuro
328
+ y alboroto pa el hembraje,
329
+ pa preparar los potajes
330
+ y osequiar bien a la gente,
331
+ y así, pues, muy grandemente,
332
+ pasaba siempre el gauchaje.
333
+
334
+ 42
335
+ Vení, a la carne con cuero,
336
+ la sabrosa carbonada,
337
+ mazamorra pien pisada,
338
+ los pasteles y el güen vino...
339
+ pero ha querido el destino
340
+ que todo aquello acabara.
341
+
342
+ 43
343
+ Estaba el gaucho en su pago
344
+ con toda siguridá,
345
+ pero aura... ¡barbaridá!,
346
+ La cosa anda tan fruncida,
347
+ que gasta el pobre la vida
348
+ en juir de la autoridá.
349
+
350
+ 44
351
+ Pues si usté pisa en su rancho
352
+ y si el alcalde lo sabe,
353
+ lo caza lo mesmo que ave
354
+ aunque su mujer aborte...
355
+ ¡no hay tiempo que no se acabe
356
+ ni tiento que no se corte!.
357
+
358
+ 45
359
+ Y al punto dese por muerto
360
+ si el alcalde lo bolea,
361
+ pues ahí nomás se le apea
362
+ con una felpa de palos;
363
+ Y después dicen que es malo
364
+ el gaucho si los pelea.
365
+
366
+ 46
367
+ Y el lomo le hinchan a golpes,
368
+ y le rompen la cabeza,
369
+ y luego con ligereza,
370
+ ansí lastimao y todo,
371
+ lo amarran codo a codo
372
+ y pa el cepo lo enderiezan.
373
+
374
+ 47
375
+ Áhi comienzan sus desgracias,
376
+ áhi principia el pericón,
377
+ porque ya no hay salvación,
378
+ y que usté quiera o no quiera,
379
+ lo mandan a la frontera
380
+ o lo echan a un batallón.
381
+
382
+ 48
383
+ Ansí empezaron mis males
384
+ lo mesmo que los de tantos;
385
+ si gustan... en otros cantos
386
+ les diré lo que he sufrido,
387
+ después que uno está... perdido
388
+ no lo salvan ni los santos.
389
+
390
+
391
+ III - Sirviendo en la frontera.
392
+
393
+ 49
394
+ tuve en mi pago en un tiempo
395
+ hijos, hacienda y mujer,
396
+ pero empecé a padecer,
397
+ me echaron a la frontera,
398
+ ¡y qué iba a hallar al volver!
399
+ Tan sólo hallé la tapera.
400
+
401
+ 50
402
+ Sosegao vivía en mi rancho
403
+ como el pájaro en su nido,
404
+ allí mis hijos queridos
405
+ iban creciendo a mi lao...
406
+ sólo queda al desgraciao
407
+ lamentar el bien perdido.
408
+
409
+ 51
410
+ Mi gala en las pulperías
411
+ era, en habiendo más gente,
412
+ ponerme medio caliente,
413
+ pues cuando puntiao me encuentro
414
+ me salen coplas de adentro
415
+ como agua de la virtiente.
416
+
417
+ 52
418
+ Cantando estaba una vez
419
+ en una gran diversión,
420
+ y aprovecho la ocasión
421
+ como quiso el juez de paz...
422
+ se presentó, y ahi nomás
423
+ hizo arriada en montón.
424
+
425
+ 53
426
+ Juyeron los más matreros
427
+ y lograron escapar:
428
+ yo no quise disparar,
429
+ soy manso y no había porqué,
430
+ muy tranquilo me quedé
431
+ y ansí me dejé agarrar
432
+
433
+ 54
434
+ allí un gringo con un órgano
435
+ y una mona que bailaba,
436
+ haciéndonos rair estaba,
437
+ cuanto le tocó el arreo,
438
+ ¡tan grande el gringo y tan feo,
439
+ lo viera cómo lloraba!.
440
+
441
+ 55
442
+ Hasta un inglés zanjiador
443
+ que decía en la última guerra
444
+ que él era de incalaperra
445
+ y que no quería servir,
446
+ también tuvo que juir
447
+ a guarecerse en la sierra.
448
+
449
+ 56
450
+ Ni los mirones salvaron
451
+ de esa arriada de mi flor,
452
+ fue acoyarao el cantor
453
+ con el gringo de la mona,
454
+ a uno solo, por favor,
455
+ logró salvar la patrona.
456
+
457
+ 57
458
+ Formaron un contingente
459
+ con los que del baile arriaron,
460
+ con otros nos mesturaron,
461
+ que habían agarrao también,
462
+ las cosas que aquí se ven
463
+ ni los diablos las pensaron.
464
+
465
+ 58
466
+ A mí el juez me tomó entre ojos
467
+ en la ultima votación:
468
+ me le había hecho el remolón
469
+ y no me arrimé ese día,
470
+ y él dijo que yo servía
471
+ a los de la esposición.
472
+
473
+ 59
474
+ Y ansí sufrí ese castigo
475
+ tal vez por culpas ajenas,
476
+ que sean malas o sean güenas
477
+ las listas, siempre me escondo:
478
+ yo soy un gaucho redondo
479
+ y esas cosas no me enllenan.
480
+
481
+ 60
482
+ Al mandarnos nos hicieron
483
+ más promesas que a un altar,
484
+ el juez nos jue a proclamar
485
+ y nos dijo muchas veces:
486
+ muchachos, a los seis meses
487
+ los van a ir a relevar.
488
+
489
+ 61
490
+ Yo llevé un moro de número
491
+ ¡sobresaliente el matucho!
492
+ Con él gané en ayacucho
493
+ más plata que agua bendita:
494
+ siempre el gaucho necesita
495
+ un pingo pa fiarle un pucho.
496
+
497
+ 62
498
+ Y cargué sin dar mas güeltas
499
+ con las prendas que tenía:
500
+ jergas, ponchos, todo cuanto había
501
+ en casa, tuito lo alcé:
502
+ a mi china la dejé
503
+ medio desnuda ese día.
504
+
505
+ 63
506
+ No me falta una guasca,
507
+ esa ocasión eché el resto,
508
+ bozal, maniador, cabresto,
509
+ lazo, bolas y manea...
510
+ ¡el que hoy tan pobre me vea
511
+ tal vez no creerá todo esto!.
512
+
513
+ 64
514
+ Ansí en mi moro, escarciando,
515
+ enderecé a la frontera.
516
+ ¡Aparcero si usté viera
517
+ lo que se llama cantón!...
518
+ Ni envidia tengo al ratón
519
+ en aquella ratonera.
520
+
521
+ 65
522
+ De los pobres que allí había
523
+ a ninguno lo largaron,
524
+ los más viejos rezongaron,
525
+ pero a uno que se quejó
526
+ en seguida lo estaquiaron,
527
+ y la cosa se acabó.
528
+
529
+ 66
530
+ En la lista de la tarde
531
+ el jefe nos cantó el punto
532
+ diciendo: quinientos juntos
533
+ llevará el que se resierte;
534
+ lo haremos pitar del juerte,
535
+ mas bien dese por dijunto.
536
+
537
+ 67
538
+ A naides le dieron armas,
539
+ pues toditas las que había
540
+ el coronel las tenía,
541
+ sigún dijo esa ocasión,
542
+ pa repartirlas el día
543
+ en que hubiera una invasión.
544
+
545
+ 68
546
+ Al principio nos dejaron
547
+ de haraganes criando sebo,
548
+ pero después... no me atrevo
549
+ a decir lo que pasaba...
550
+ ¡barajo!... Si nos trataban
551
+ como se trata a malevos.
552
+
553
+ 69
554
+ Porque todo era jugarle
555
+ por los lomos con la espada,
556
+ y aunque usté no hiciera nada,
557
+ lo mesmito que en palermo,
558
+ le daban cada cepiada
559
+ que lo dejaban enfermo.
560
+
561
+ 70
562
+ ¡Y qué indios, ni qué servicio;
563
+ si allí no había ni cuartel!
564
+ Nos mandaba el coronel
565
+ a trabajar en sus chacras,
566
+ y dejábamos las vacas
567
+ que las llevara el infiel.
568
+
569
+ 71
570
+ Yo primero sembré trigo
571
+ y después hice un corral,
572
+ corté adobe pa un tapial,
573
+ hice un quincho, corté paja...
574
+ ¡la pucha que se trabaja
575
+ sin que le larguen un rial!.
576
+
577
+ 72
578
+ Y es lo pior de aquel enriedo
579
+ que si uno anda hinchando el lomo
580
+ se le apean como un plomo...
581
+ ¡quién aguanta aquel infierno!
582
+ si eso es servir al gobierno,
583
+ a mí no me gusta el cómo.
584
+
585
+ 73
586
+ Más de un año nos tuvieron
587
+ en esos trabajos duros;
588
+ y los indios, le asiguro
589
+ dentraban cuando querían:
590
+ como no los perseguían,
591
+ siempre andaban sin apuro.
592
+
593
+ 74
594
+ A veces decía al volver
595
+ del campo la descubierta
596
+ que estuviéramos alerta,
597
+ que andaba adentro la indiada,
598
+ porque había una rastrillada
599
+ o estaba una yegua muerta.
600
+
601
+ 75
602
+ Recién entonces salía
603
+ la orden de hacer la riunión,
604
+ y caíbamos al cantón
605
+ en pelos y hasta enancaos,
606
+ sin armas, cuatro pelaos
607
+ que íbamos a hacer jabón.
608
+
609
+ 76
610
+ Ahi empezaba el afán
611
+ -se entiende, de puro vicio-
612
+ de enseñarle el ejercicio
613
+ a tanto gaucho recluta,
614
+ con un estrutor... ¡qué... Bruta!
615
+ que nunca sabía su oficio.
616
+
617
+ 77
618
+ Daban entonces las armas
619
+ pa defender los cantones,
620
+ que eran lanzas y latones
621
+ con ataduras de tiento...
622
+ las de juego no las cuento
623
+ porque no había municiones.
624
+
625
+ 78
626
+ Y un sargento chamuscao
627
+ me contó que las tenían
628
+ pero que ellos la vendían
629
+ para cazar avestruces;
630
+ y así andaban noche y día
631
+ dele bala a los ñanduces.
632
+
633
+ 79
634
+ Y cuando se iban los indios
635
+ con lo que habían manotiao,
636
+ salíamos muy apuraos
637
+ a perseguirlos de atrás;
638
+ si no se llevaban más
639
+ es porque no habían hallao.
640
+
641
+ 80
642
+ Allí sí, se ven desgracias
643
+ y lágrimas y afliciones;
644
+ naides le pida perdones
645
+ al indio: pues donde dentra,
646
+ roba y mata cuanto encuentra
647
+ y quema las poblaciones.
648
+
649
+ 81
650
+ No salvan de su juror
651
+ ni los pobres angelitos;
652
+ viejos, mozos y chiquitos
653
+ los mata del mesmo modo:
654
+ que el indio lo arregla todo
655
+ con la lanza y con gritos.
656
+
657
+ 82
658
+ Tiemblan las carnes al verlo
659
+ volando al viento la cerda,
660
+ la rienda en la mano izquierda
661
+ y la lanza en la derecha;
662
+ ande enderieza abre brecha
663
+ pues no hay lanzazo que pierda.
664
+
665
+ 83
666
+ Hace trotiadas tremendas
667
+ desde el fondo del desierto;
668
+ ansí llega medio muerto
669
+ de hambre, de sé y de fatiga;
670
+ pero el indio es una hormiga
671
+ que día y noche está despierto.
672
+
673
+ 84
674
+ Sabe manejar las bolas
675
+ como naides las maneja;
676
+ cuanto el contrario se aleja,
677
+ manda una bola perdida,
678
+ y si lo alcanza, sin vida
679
+ es siguro que lo deja.
680
+
681
+ 85
682
+ Y el indio es como tortuga
683
+ de duro para espichar;
684
+ si lo llega a destripar
685
+ ni siquiera se le encoge;
686
+ luego sus tripas recoge,
687
+ y se agacha a disparar.
688
+
689
+ 86
690
+ Hacían el robo a su gusto
691
+ y después se iban de arriba;
692
+ se llevaban las cautivas,
693
+ y nos contaban que a veces
694
+ les descarnaban los pieses,
695
+ a las pobrecitas, vivas.
696
+
697
+ 87
698
+ ¡Ah! ¡si partía el corazón
699
+ ver tantos males, canejo!
700
+ los perseguíamos de lejos
701
+ sin poder ni galopiar;
702
+ ¡y qué habíamos de alcanzar
703
+ en unos vichocos viejos!
704
+
705
+ 88
706
+ Nos volvíamos al cantón
707
+ a las dos o tres jornadas,
708
+ sembrando las caballadas;
709
+ y pa que alguno la venda,
710
+ rejuntábamos la hacienda
711
+ que habían dejao rezagada.
712
+
713
+ 89
714
+ Una vez entre otras muchas,
715
+ tanto salir al botón,
716
+ nos pegaron un malón
717
+ los indios y una lanciada,
718
+ que la gente acobardada
719
+ quedó dende esa ocasión.
720
+
721
+ 90
722
+ Habían estao escondidos
723
+ aguaitando atrás de un cerro...
724
+ ¡lo viera a su amigo Fierro
725
+ aflojar como un blandito!
726
+ salieron como maíz frito
727
+ en cuanto sonó un cencerro.
728
+
729
+ 91
730
+ Al punto nos dispusimos
731
+ aunque ellos eran bastantes;
732
+ la formamos al instante
733
+ nuestra gente, que era poca,
734
+ y golpiándose en la boca
735
+ hicieron fila adelante.
736
+
737
+ 92
738
+ Se vinieron en tropel
739
+ haciendo temblar la tierra.
740
+ no soy manco pa la guerra
741
+ pero tuve mi jabón,
742
+ pues iba en un redomón
743
+ que había boleao en la sierra.
744
+
745
+ 93
746
+ ¡Qué vocerío! ¡qué barullo!
747
+ ¡qué apurar esa carrera!
748
+ la indiada todita entera
749
+ dando alaridos cargó,
750
+ ¡jue pucha!... Y ya nos sacó
751
+ como yeguada matrera.
752
+
753
+ 94
754
+ ¡Qué fletes traiban los bárbaros!
755
+ ¡como una luz de ligeros!
756
+ hicieron el entrevero
757
+ y en aquella mezcolanza,
758
+ este quiero, éste no quiero,
759
+ nos escogían con la lanza.
760
+
761
+ 95
762
+ Al que le daban un chuzazo,
763
+ dificultoso es que sane.
764
+ en fin, para no echar panes,
765
+ salimos por esas lomas,
766
+ lo mesmo que las palomas
767
+ al juir de los gavilanes.
768
+
769
+ 96
770
+ ¡Es de almirar la destreza
771
+ con que la lanza manejan!
772
+ de perseguir nunca dejan,
773
+ y nos traiban apretaos.
774
+ ¡si queríamos, de apuraos,
775
+ salirnos por las orejas!
776
+
777
+ 97
778
+ Y pa mejor de la fiesta
779
+ en esa aflición tan suma,
780
+ vino un indio echando espuma,
781
+ y con la lanza en la mano,
782
+ gritando: acabáu cristiano,
783
+ metau el lanza hasta el pluma.
784
+
785
+ 98
786
+ Tendido en el costillar,
787
+ cimbrando por sobre el brazo
788
+ una lanza como un lazo,
789
+ me atropelló dando gritos:
790
+ si me descuido... El maldito
791
+ me levanta de un lanzazo.
792
+
793
+ 99
794
+ Si me atribulo o me encojo,
795
+ siguro que no me escapo:
796
+ siempre he sido medio guapo,
797
+ pero en aquella ocasión
798
+ me hacía buya el corazón
799
+ como la garganta al sapo.
800
+
801
+ 100
802
+ Dios le perdone al salvaje
803
+ las ganas que me tenía...
804
+ desaté las tres marías
805
+ y lo engatusé a cabriolas...
806
+ ¡pucha...! Si no traigo bolas
807
+ me achura el indio ese día.
808
+
809
+ 101
810
+ Era el hijo de un cacique,
811
+ sigún yo lo averigüé;
812
+ la verdá del caso jue
813
+ que me tuvo apuradazo,
814
+ hasta que por fin de un bolazo
815
+ del caballo lo bajé.
816
+
817
+ 102
818
+ Ahi no más me tiré al suelo
819
+ y lo pisé en las paletas;
820
+ empezó a hacer morisquetas
821
+ y a mezquinar la garganta...
822
+ pero yo hice la obra santa
823
+ de hacerlo estirar la jeta.
824
+
825
+ 103
826
+ Allí quedó de mojón
827
+ y en su caballo salté;
828
+ de la indiada disparé,
829
+ pues si me alcanza me mata,
830
+ y al fin me les escapé,
831
+ con el hilo de una pata.
832
+
833
+
834
+ IV - El pulpero. A buena cuenta.
835
+
836
+ 104
837
+ seguiré esta relación,
838
+ aunque pa chorizo es largo:
839
+ el que pueda hágase cargo
840
+ cómo andaría de matrero,
841
+ después de salvar el cuero
842
+ de aquel trance tan amargo.
843
+
844
+ 105
845
+ Del sueldo nada les cuento,
846
+ porque andaba disparando;
847
+ nosotros de cuando en cuando
848
+ solíamos ladrar de pobres:
849
+ nunca llegaban los cobres
850
+ que se estaban aguardando.
851
+
852
+ 106
853
+ Y andábamos de mugrientos
854
+ que el mirarnos daba horror;
855
+ les juro que era un dolor
856
+ ver esos hombres, ¡por cristo!
857
+ En mi perra vida he visto
858
+ una miseria mayor.
859
+
860
+ 107
861
+ Yo no tenía ni camisa
862
+ ni cosa que se parezca;
863
+ mis trapos sólo pa yesca
864
+ me podían servir al fin...
865
+ no hay plaga como un fortín
866
+ para que el hombre padezca.
867
+
868
+ 108
869
+ Poncho, jergas, el apero,
870
+ las prenditas, los botones,
871
+ todo, amigo, en los cantones
872
+ jue quedando poco a poco;
873
+ ya me tenían medio loco
874
+ la pobreza y los ratones.
875
+
876
+ 109
877
+ Sólo una manta peluda
878
+ era cuanto me quedaba
879
+ la había agenciao a la tabla
880
+ y ella me tapaba el bulto;
881
+ yaguané que allí ganaba
882
+ no salía- ni con indulto.
883
+
884
+ 110
885
+ Y pa mejor hasta el moro
886
+ se me jue de entre las manos;
887
+ no soy lerdo pero, hermano,
888
+ vino el comendante un día
889
+ diciendo que lo quería
890
+ pa enseñarle a comer grano.
891
+
892
+ 111
893
+ Afigúrese cualquiera
894
+ la suerte de este su amigo,
895
+ a pie y mostrando el umbligo,
896
+ estropiao, pobre y desnudo;
897
+ ni por castigo se pudo
898
+ hacerse más mal conmigo.
899
+
900
+ 112
901
+ Ansí pasaron los meses,
902
+ y vino el año siguiente,
903
+ y las cosas igualmente
904
+ siguieron del mesmo modo:
905
+ adrede parece todo
906
+ pa atormentar a la gente.
907
+
908
+ 113
909
+ No teníamos más permiso,
910
+ ni otro alivio la gauchada,
911
+ que salir de madrugada,
912
+ cuando no había indio ninguno,
913
+ campo ajuera a hacer boliadas
914
+ desocando los reyunos.
915
+
916
+ 114
917
+ Y cáibamos al cantón
918
+ con los fletes aplastaos,
919
+ pero a veces medio aviaos
920
+ con plumas y algunos cueros,
921
+ que pronto con el pulpero
922
+ los teníamos negociaos.
923
+
924
+ 115
925
+ Era un amigo del jefe
926
+ que con un boliche estaba;
927
+ yerba y tabaco nos daba
928
+ por la pluma de avestruz,
929
+ y hasta le hacía ver la luz
930
+ al que un cuero le llevaba.
931
+
932
+ 116
933
+ Sólo tenía cuatro frascos
934
+ y unas barricas vacías,
935
+ y a la gente le vendía
936
+ todo cuanto precisaba...
937
+ algunos creiban que estaba
938
+ allí la proveduría.
939
+
940
+ 117
941
+ ¡Ah, pulpero habilidoso!
942
+ Nada le solía faltar.
943
+ ¡Ahijuna!, Para tragar
944
+ tenía un buche de ñandú;
945
+ la gente le dio en llamar
946
+ el boliche de virtú.
947
+
948
+ 118
949
+ Aunque es justo que quien vende
950
+ algún poquito muerda,
951
+ tiraba tanto la cuerda
952
+ que, con sus cuatro limetas
953
+ él cargaba las carretas
954
+ de plumas, cueros y cerda.
955
+
956
+ 119
957
+ Nos tenía apuntaos a todos
958
+ con más cuentas que un rosario,
959
+ cuando se anunció un salario
960
+ que iban a dar, o un socorro;
961
+ pero sabe Dios qué zorro
962
+ se lo comió al comisario;
963
+
964
+ 120
965
+ pues nunca lo vi llegar,
966
+ y al cabo de muchos días
967
+ en la mesma pulpería
968
+ dieron una güena cuenta,
969
+ que la gente muy contenta
970
+ de tan pobre recibía.
971
+
972
+ 121
973
+ Sacaron unos sus prendas,
974
+ que las tenían empeñadas;
975
+ por sus deudas atrasadas
976
+ dieron otros el dinero;
977
+ al fin de fiesta el pulpero
978
+ se quedó con la mascada.
979
+
980
+ 122
981
+ Yo me arrescosté a un horcón
982
+ dando tiempo a que pagaran,
983
+ y poniendo güena cara
984
+ estuve haciéndome el poyo,
985
+ a esperar que me llamaran
986
+ para recibir mi boyo.
987
+
988
+ 123
989
+ Pero ahi me puede quedar
990
+ pegao pa siempre al horcón,
991
+ ya era casi la oración
992
+ y ninguno me llamaba;
993
+ la cosa se me ñublaba
994
+ y me dentró comezón.
995
+
996
+ 124
997
+ Pa sacarme el entripao
998
+ vi al mayor, y lo fi a hablar;
999
+ yo me lo empecé a atracar,
1000
+ y como con poca gana
1001
+ le dije: tal vez mañana
1002
+ acabarán de pagar.
1003
+
1004
+ 125
1005
+ ¡Que mañana ni otro día!,
1006
+ Al punto me contestó:
1007
+ la paga ya se acabó;
1008
+ ¡siempre has de ser animal!
1009
+ Me raí y le dije: yo...
1010
+ no he recebido ni un rial.
1011
+
1012
+ 126
1013
+ Se le pusieron los ojos
1014
+ que se le querían salir,
1015
+ y ahi no más volvió a decir
1016
+ comiéndome con la vista:
1017
+ ¿y qué querés recibir
1018
+ si no has dentrao en la lista?
1019
+
1020
+ 127
1021
+ Esto sí que es amolar,
1022
+ dije yo pa mis adentros;
1023
+ van dos años que me encuentro
1024
+ y hasta aura he visto ni un grullo;
1025
+ dentro en todos los barullos
1026
+ pero en las listas no dentro.
1027
+
1028
+ 128
1029
+ Vide el pleito mal parao
1030
+ y no quise aguardar más...
1031
+ es güeno vivir en paz
1032
+ con quien nos ha de mandar;
1033
+ y reculando pa atrás
1034
+ me le empecé a retirar.
1035
+
1036
+ 129
1037
+ Supo todo el comendante
1038
+ y me llamó al otro día,
1039
+ diciéndome que quería
1040
+ aviriguar bien las cosas...
1041
+ que no era el tiempo de rosas,
1042
+ que aura a naides se debía.
1043
+
1044
+ 130
1045
+ Llamó al cabo y al sargento
1046
+ y empezó la indagación:
1047
+ si había venido al cantón
1048
+ en tal tiempo o en tal otro...
1049
+ y si había venido en potro,
1050
+ en reyuno o redomón.
1051
+
1052
+ 131
1053
+ Y todo era alborotar
1054
+ al ñudo, y hacer papel;
1055
+ conocí que era pastel
1056
+ pa engordar con mi guayaca;
1057
+ mas si voy al coronel
1058
+ me hacen bramar en la estaca.
1059
+
1060
+ 132
1061
+ ¡Ah, hijos de una...! ¡La codicia
1062
+ ojalá les ruempa el saco!
1063
+ Ni un pedazo de tabaco
1064
+ le dan al pobre soldao,
1065
+ y lo tienen, de delgao,
1066
+ más ligero que un guanaco.
1067
+
1068
+ 133
1069
+ Pero qué iba a hacerles yo,
1070
+ charabón en el desierto;
1071
+ más bien me daba por muerto
1072
+ pa no verme más fundido:
1073
+ y me les hacía el dormido
1074
+ aunque soy medio despierto.
1075
+
1076
+
1077
+ V - Gringos en la frontera. La estaquiada.
1078
+
1079
+ 134
1080
+ Yo andaba desesperao,
1081
+ aguardando una ocasión
1082
+ que los indios un malón
1083
+ nos dieran, y entre el estrago
1084
+ hacérmeles cimarrón
1085
+ y volverme pa mi pago.
1086
+
1087
+ 135
1088
+ Aquello no era servicio
1089
+ ni defender la frontera;
1090
+ aquello era ratonera
1091
+ en que sólo gana el juerte:
1092
+ era jugar a la suerte
1093
+ con una taba culera.
1094
+
1095
+ 136
1096
+ Allí tuito va al revés;
1097
+ los milicos son los piones,
1098
+ y andan en las poblaciones
1099
+ emprestaos pa trabajar;
1100
+ los rejuntan pa peliar
1101
+ cuando entran indios ladrones.
1102
+
1103
+ 137
1104
+ Yo he visto en esa milonga
1105
+ muchos jefes con estancia,
1106
+ y piones en abundancia,
1107
+ y majadas y rodeos;
1108
+ he visto negocios feos
1109
+ a pesar de mi inorancia.
1110
+
1111
+ 138
1112
+ Y colijo que no quieren
1113
+ la barunda componer;
1114
+ para eso no ha de tener,
1115
+ el jefe que esté de estable,
1116
+ más que su poncho y su sable,
1117
+ su caballo y su deber.
1118
+
1119
+ 139
1120
+ Ansina, pues, conociendo
1121
+ que aquel mal no tiene cura,
1122
+ que tal vez mi sepoltura
1123
+ si me quedo iba a encontrar,
1124
+ pensé mandarme mudar
1125
+ como cosa más sigura.
1126
+
1127
+ 140
1128
+ Y pa mejor, una noche
1129
+ ¡qué estaquiada me pegaron!
1130
+ Casi me descoyuntaron
1131
+ por motivo de una gresca:
1132
+ ¡ahijuna, si me estiraron
1133
+ lo mesmo que guasca fresca!
1134
+
1135
+ 141
1136
+ Jamás me puedo olvidar
1137
+ lo que esa vez me pasó;
1138
+ dentrando una noche yo
1139
+ al fortín, un enganchao,
1140
+ que estaba medio mamao,
1141
+ allí me desconoció.
1142
+
1143
+ 142
1144
+ Era un gringo tan bozal,
1145
+ que nada se le entendía,
1146
+ ¡quién sabe de ande sería!
1147
+ Tal vez no juera cristiano,
1148
+ pues lo único que decía
1149
+ es que era papolitano.
1150
+
1151
+ 143
1152
+ Estaba de centinela
1153
+ y por causa del peludo
1154
+ verme más claro no pudo,
1155
+ y esa jue la culpa toda:
1156
+ el bruto se asustó al ñudo
1157
+ y fi el pavo de la boda.
1158
+
1159
+ 144
1160
+ Cuando me vido acercar:
1161
+ quién vivore-? Preguntó;
1162
+ ¿qué víboras?, Dije yo.
1163
+ ¡Ha garto!, Me pegó el grito,
1164
+ y yo dije despacito:
1165
+ ¡más lagarto serás vos!
1166
+
1167
+ 145
1168
+ Ahi no más, ¡cristo me valga!,
1169
+ Rastrillar el jusil siento:
1170
+ me agaché, y en el momento
1171
+ el bruto me largó un chumbo;
1172
+ mamao, me tiró sin rumbo,
1173
+ que si no, no cuento el cuento.
1174
+
1175
+ 146
1176
+ Por de contao, con el tiro
1177
+ se alborotó el avispero;
1178
+ los oficiales salieron
1179
+ y se empezó la junción;
1180
+ quedó en su puesto el nación,
1181
+ y yo fi al estaquiadero.
1182
+
1183
+ 147
1184
+ Entre cuatro bayonetas
1185
+ me tendieron en el suelo;
1186
+ vino el mayor medio en pedo
1187
+ y allí se puso a gritar:
1188
+ ¡pícaro, te he de enseñar
1189
+ andar reclamando sueldos!
1190
+
1191
+ 148
1192
+ De las manos y las patas
1193
+ me ataron cuatro cinchones;
1194
+ les aguanté los tirones
1195
+ sin que ni un ¡ay! Se me oyera,
1196
+ y al gringo la noche entera
1197
+ lo harté con mis maldiciones.
1198
+
1199
+ 149
1200
+ Yo no sé porqué el gobierno
1201
+ nos manda aquí a la frontera
1202
+ gringada que ni siquiera
1203
+ se sabe atracar a un pingo.
1204
+ ¡Si creerá al mandar un gringo
1205
+ que nos manda alguna fiera!
1206
+
1207
+ 150
1208
+ No hacen más que dar trabajo,
1209
+ pues no saben ni ensillar;
1210
+ no sirven ni pa carniar:
1211
+ y yo he visto muchas veces
1212
+ que ni voltiadas las reses
1213
+ se les querían arrimar.
1214
+
1215
+ 151
1216
+ Y lo pasan sus mercedes
1217
+ lengüetiando pico a pico
1218
+ hasta que viene un milico
1219
+ a servirles al asao-
1220
+ y eso sí, en lo delicaos,
1221
+ parecen hijos de rico.
1222
+
1223
+ 152
1224
+ Si hay calor, ya no son gente;
1225
+ si yela, todos tiritan;
1226
+ si usté no les da, no pitan
1227
+ por no gastar en tabaco,
1228
+ y cuando pescan un naco
1229
+ uno al otro se lo quitan.
1230
+
1231
+ 153
1232
+ Cuando llueve se acoquinan
1233
+ como perro que oye truenos.
1234
+ ¡Que diablos!, Sólo son güenos
1235
+ pa vivir entre maricas,
1236
+ y nunca se andan con chicas
1237
+ para alzar ponchos ajenos.
1238
+
1239
+ 154
1240
+ Pa vichar son como ciegos;
1241
+ no hay ejemplo de que entiendan,
1242
+ ni hay uno solo que aprienda,
1243
+ al ver un bulto que cruza,
1244
+ a saber si es avestruza,
1245
+ o si es jinete, o hacienda.
1246
+
1247
+ 155
1248
+ Si salen a perseguir
1249
+ después de mucho aparato,
1250
+ tuitos se pelan al rato
1251
+ y va quedando el tendal:
1252
+ esto es como en un nidal
1253
+ echarle güevos a un gato.
1254
+
1255
+
1256
+ VI - Desertor. Las ruinas del rancho.
1257
+
1258
+ 156
1259
+ vamos dentrando recién
1260
+ a la parte mas sentida,
1261
+ aunque es todita mi vida
1262
+ de males una cadena:
1263
+ a cada alma dolorida
1264
+ le gusta cantar sus penas.
1265
+
1266
+ 157
1267
+ Se empezó en aquel entonces
1268
+ a rejuntar caballada,
1269
+ y riunir la milicada
1270
+ teniéndola en el cantón,
1271
+ para una despedición
1272
+ a sorprender a la indiada.
1273
+
1274
+ 158
1275
+ Nos anunciaban que iríamos
1276
+ sin carretas ni bagajes
1277
+ a golpiar a los salvajes
1278
+ en sus mesmas tolderías;
1279
+ que a la güelta pagarían
1280
+ licenciándolo al gauchaje;
1281
+
1282
+ 159
1283
+ que en esta despedición
1284
+ tuviéramos la esperanza;
1285
+ que iba a venir sin tardanza,
1286
+ según el jefe contó,
1287
+ un menistro o qué sé yo-
1288
+ que le llamaban don ganza;
1289
+
1290
+ 160
1291
+ que iba a riunir el ejército
1292
+ y tuitos los batallones,
1293
+ y que traiba unos cañones
1294
+ con más rayas que un cotín;
1295
+ ¡pucha!- Las conversaciones
1296
+ por allá no tenían fin.
1297
+
1298
+ 161
1299
+ Pero esas trampas no enriedan
1300
+ a los zorros de mi laya;
1301
+ que esa ganza venga o vaya,
1302
+ poco le importa a un matrero.
1303
+ Yo también dejé las rayas-
1304
+ en los libros del pulpero.
1305
+
1306
+ 162
1307
+ Nunca juí gaucho dormido;
1308
+ siempre pronto, siempre listo,
1309
+ yo soy un hombre, ¡qué cristo!,
1310
+ Que nada me ha acobardao,
1311
+ y siempre salí parao
1312
+ en los trances que me he visto.
1313
+
1314
+ 163
1315
+ Dende chiquito gané
1316
+ la vida con mi trabajo,
1317
+ y aunque siempre estuve abajo
1318
+ y no sé lo que es subir
1319
+ también el mucho sufrir
1320
+ suele cansarnos, ¡barajo!
1321
+
1322
+ 164
1323
+ En medio de mi inorancia
1324
+ conozco que nada valgo:
1325
+ soy la liebre o soy el galgo
1326
+ asigún los tiempos andan;
1327
+ pero también los que mandan
1328
+ debieran cuidarnos algo.
1329
+
1330
+ 165
1331
+ Una noche que riunidos
1332
+ estaban en la carpeta
1333
+ empinando una limeta
1334
+ el jefe y el juez de paz,
1335
+ yo no quise aguardar más,
1336
+ y me hice humo en un sotreta.
1337
+
1338
+ 166
1339
+ Me parece el campo orégano
1340
+ dende que libre me veo;
1341
+ donde me lleva el deseo
1342
+ allí mis pasos dirijo,
1343
+ y hasta en las sombras de fijo
1344
+ que donde quiera rumbeo.
1345
+
1346
+ 167
1347
+ Entro y salgo del peligro
1348
+ sin que me espante el estrago,
1349
+ no aflojo al primer amago
1350
+ ni jamás fi gaucho lerdo:
1351
+ soy pa rumbiar como el cerdo,
1352
+ y pronto caí a mi pago.
1353
+
1354
+ 168
1355
+ Volvía al cabo de tres años
1356
+ de tanto sufrir al ñudo
1357
+ resertor, pobre y desnudo,
1358
+ a procurar suerte nueva;
1359
+ y lo mesmo que el peludo
1360
+ enderecé pa mi cueva.
1361
+
1362
+ 169
1363
+ No hallé ni rastro del rancho:
1364
+ ¡sólo estaba la tapera!
1365
+ ¡Por cristo si aquello era
1366
+ pa enlutar el corazón!
1367
+ ¡Yo juré en esa ocasión
1368
+ ser mas malo que una fiera!
1369
+
1370
+ 170
1371
+ ¡Quién no sentirá lo mesmo
1372
+ cuando ansí padece tanto!
1373
+ Puedo asigurar que el llanto
1374
+ como una mujer largué:
1375
+ ¡ay, mi Dios: si me quedé
1376
+ más triste que jueves santo!
1377
+
1378
+ 171
1379
+ Sólo se oíban los aullidos
1380
+ de un gato que se salvó;
1381
+ el pobre se guareció
1382
+ cerca, en una vizcachera:
1383
+ venía como si supiera
1384
+ que estaba de güelta yo.
1385
+
1386
+ 172
1387
+ Al dirme dejé la hacienda
1388
+ que era todito mi haber;
1389
+ pronto debíamos volver,
1390
+ sigún el juez prometía,
1391
+ y hasta entonces cuidaría
1392
+ de los bienes, la mujer.
1393
+
1394
+ 173
1395
+ Después me contó un vecino
1396
+ que el campo se lo pidieron;
1397
+ la hacienda se la vendieron
1398
+ pa pagar arrendamientos,
1399
+ y qué sé yo cuantos cuentos;
1400
+ pero todo lo fundieron,
1401
+
1402
+ 174
1403
+ los pobrecitos muchachos,
1404
+ entre tantas afliciones,
1405
+ se conchabaron de piones;
1406
+ ¡mas qué iban a trabajar,
1407
+ si eran como los pichones
1408
+ sin acabar de emplumar!
1409
+
1410
+ 175
1411
+ Por ahi andarán sufriendo
1412
+ de nuestra suerte el rigor:
1413
+ me han contao que el mayor
1414
+ nunca dejaba a su hermano;
1415
+ puede ser que algún cristiano
1416
+ los recoja por favor.
1417
+
1418
+ 176
1419
+ ¡Y la pobre mi mujer,
1420
+ Dios sabe cuánto sufrió!
1421
+ Me dicen que se voló
1422
+ con no sé qué gavilán:
1423
+ sin duda a buscar el pan
1424
+ que no podía darle yo.
1425
+
1426
+ 177
1427
+ No es raro que a uno le falte
1428
+ lo que a algún otro le sobre
1429
+ si no le quedó ni un cobre
1430
+ sino de hijos un enjambre.
1431
+ Que más iba a hacer la pobre
1432
+ para no morirse de hambre?
1433
+
1434
+ 178
1435
+ ¡Tal vez no te vuelva a ver,
1436
+ prienda de mi corazón!
1437
+ Dios te dé su proteción
1438
+ ya que no me la dio a mí,
1439
+ y a mis hijos dende aquí
1440
+ les echo mi bendición.
1441
+
1442
+ 179
1443
+ Como hijitos de la cuna
1444
+ andarán por ahi sin madre;
1445
+ ya se quedaron sin padre,
1446
+ y ansí la suerte los deja
1447
+ sin naides que los proteja
1448
+ y sin perro que les ladre.
1449
+
1450
+ 180
1451
+ Los pobrecitos tal vez
1452
+ no tengan ande abrigarse,
1453
+ ni ramada ande ganarse,
1454
+ ni rincón ande meterse,
1455
+ ni camisa que ponerse,
1456
+ ni poncho con que taparse.
1457
+
1458
+ 181
1459
+ Tal vez los verán sufrir
1460
+ sin tenerles compasión;
1461
+ puede que alguna ocasión,
1462
+ aunque los vean tiritando,
1463
+ los echen de algún jogón
1464
+ pa que no estén estorbando.
1465
+
1466
+ 182
1467
+ Y al verse ansina espantaos
1468
+ como se espanta a los perros,
1469
+ irán los hijos de Fierro,
1470
+ con la cola entre las piernas,
1471
+ a buscar almas más tiernas
1472
+ o esconderse en algún cerro.
1473
+
1474
+ 183
1475
+ Mas también en este juego
1476
+ voy a pedir mi bolada;
1477
+ a naides le debo nada,
1478
+ ni pido cuartel ni doy:
1479
+ y ninguno dende hoy
1480
+ ha de llevarme en la armada.
1481
+
1482
+ 184
1483
+ Yo he sido manso primero,
1484
+ y seré gaucho matrero;
1485
+ en mi triste circunstancia,
1486
+ aunque es mi mal tan projundo,
1487
+ nací y me he criado en estancia.
1488
+ Pero ya conozco el mundo.
1489
+
1490
+ 185
1491
+ Ya les conozco sus mañas,
1492
+ le conozco sus cucañas;
1493
+ sé como hacen la partida,
1494
+ la enriedan y la manejan;
1495
+ deshaceré la madeja
1496
+ aunque me cueste la vida.
1497
+
1498
+ 186
1499
+ Y aguante el que no se anime
1500
+ a meterse en tanto engorro
1501
+ o si no aprétese el gorro
1502
+ y para otra tierra emigre;
1503
+ pero yo ando como el tigre
1504
+ que le roban los cachorros.
1505
+
1506
+ 187
1507
+ Aunque muchos creen que el gaucho
1508
+ tiene alma de reyuno,
1509
+ no se encontrará a ninguno
1510
+ que no le dueblen las penas;
1511
+ mas no debe aflojar uno
1512
+ mientras hay sangre en las venas
1513
+
1514
+
1515
+ VII - Pelea con el moreno.
1516
+
1517
+ 188
1518
+ De carta de más me vía
1519
+ sin saber a donde dirme;
1520
+ mas dijeron que era vago
1521
+ y entraron a perseguirme.
1522
+
1523
+ 189
1524
+ Nunca se achican los males,
1525
+ van poco a poco creciendo,
1526
+ y ansina me vide pronto
1527
+ obligado a andar juyendo.
1528
+
1529
+ 190
1530
+ No tenía mujer ni rancho
1531
+ y a más, era resertor;
1532
+ no tenía una prenda güena
1533
+ ni un peso en el tirador
1534
+
1535
+ 191
1536
+ a mis hijos infelices
1537
+ pensé volverlos a hallar,
1538
+ y andaba de un lao al otro
1539
+ sin tener ni qué pitar.
1540
+
1541
+ 192
1542
+ Supe una vez por desgracia
1543
+ que había un baile por allí,
1544
+ y medio desesperao
1545
+ a ver la milonga fui.
1546
+
1547
+ 193
1548
+ Riunidos al pericón
1549
+ tantos amigos hallé,
1550
+ que alegre de verme entre ellos
1551
+ esa noche me apedé.
1552
+
1553
+ 194
1554
+ Como nunca, en la ocasión
1555
+ por peliar me dio la tranca.
1556
+ Y la emprendí con un negro
1557
+ que trujo una negra en ancas.
1558
+
1559
+ 195
1560
+ Al ver llegar la morena,
1561
+ que no hacía caso de naides,
1562
+ le dije con la mamúa:
1563
+ va-ca-yendo gente al baile.
1564
+
1565
+ 196
1566
+ La negra entendió la cosa
1567
+ y no tardó en contestarme,
1568
+ mirándome como a un perro:
1569
+ más vaca será su madre.
1570
+
1571
+ 197
1572
+ Y dentró al baile muy tiesa
1573
+ con más cola que una zorra,
1574
+ haciendo blanquiar los dientes
1575
+ lo mesmo que mazamorra.
1576
+
1577
+ 198
1578
+ !Negra linda!- Dije yo.
1579
+ Me gusta- pa la carona;
1580
+ y me puse a champurriar
1581
+ esta coplita fregona:
1582
+
1583
+ 199
1584
+ a los blancos hizo Dios,
1585
+ a los mulatos san pedro,
1586
+ a los negros hizo el diablo
1587
+ para tizón del infierno.
1588
+
1589
+ 200
1590
+ Había estao juntando rabia
1591
+ el moreno dende ajuera;
1592
+ en lo escuro le brillaban
1593
+ los ojos como linterna.
1594
+
1595
+ 201
1596
+ Lo conocí retobao,
1597
+ me acerqué y le dije presto:
1598
+ po-r-rudo que un hombre sea
1599
+ nunca se enoja por esto.
1600
+
1601
+ 202
1602
+ Corcovió el de los tamangos
1603
+ y creyéndose muy fijo:
1604
+ ¡más porrudo serás vos,
1605
+ gaucho rotoso!, Me dijo.
1606
+
1607
+ 203
1608
+ Y ya se me vino al humo
1609
+ como a buscarme la hebra,
1610
+ y un golpe le acomodé
1611
+ con el porrón de ginebra.
1612
+
1613
+ 204
1614
+ Ahi nomás pegó el de hollín
1615
+ mas gruñidos que un chanchito,
1616
+ y pelando el envenao
1617
+ me atropelló dando gritos.
1618
+
1619
+ 205
1620
+ Pegué un brinco y abrí cancha
1621
+ diciéndoles: caballeros,
1622
+ dejen venir ese toro.
1623
+ Solo nací- solo muero.
1624
+
1625
+ 206
1626
+ El negro, después del golpe,
1627
+ se había el poncho refalao
1628
+ y dijo: vas a saber
1629
+ si es solo o acompañado.
1630
+
1631
+ 207
1632
+ Y mientras se arremangó,
1633
+ yo me saqué las espuelas,
1634
+ pues malicié que aquel tío
1635
+ no era de arriar con las riendas.
1636
+
1637
+ 208
1638
+ No hay cosa como el peligro
1639
+ pa refrescar un mamao;
1640
+ hasta la vista se aclara
1641
+ por mucho que haiga chupao.
1642
+
1643
+ 209
1644
+ El negro me atropelló
1645
+ como a quererme comer;
1646
+ me hizo dos tiros seguidos
1647
+ y los dos le abarajé.
1648
+
1649
+ 210
1650
+ Yo tenía un facón con s,
1651
+ que era de lima de acero;
1652
+ le hice un tiro, lo quitó
1653
+ y vino ciego el moreno;
1654
+
1655
+ 211
1656
+ y en el medio de las aspas
1657
+ un planazo le asenté,
1658
+ que lo largué culebriando
1659
+ lo mesmo que buscapié.
1660
+
1661
+ 212
1662
+ Le coloriaron las motas
1663
+ con la sangre de la herida,
1664
+ y volvió a venir jurioso
1665
+ como una tigra parida.
1666
+
1667
+ 213
1668
+ Y ya me hizo relumbrar
1669
+ por los ojos el cuchillo,
1670
+ alcanzando con la punta
1671
+ a cortarme en un carrillo.
1672
+
1673
+ 214
1674
+ Me hirvió la sangre en las venas
1675
+ y me le afirmé al moreno,
1676
+ dándole de punta y hacha
1677
+ pa dejar un diablo menos.
1678
+
1679
+ 215
1680
+ Por fin en una topada
1681
+ en el cuchillo lo alcé,
1682
+ y como un saco de güesos
1683
+ contra un cerco lo largué.
1684
+
1685
+ 216
1686
+ Tiró unas cuantas patadas
1687
+ y ya cantó pal carnero:
1688
+ nunca me puedo olvidar
1689
+ de la agonía de aquel negro.
1690
+
1691
+ 217
1692
+ En esto la negra vino
1693
+ con los ojos como ají
1694
+ y empezó la pobre allí
1695
+ a bramar como una loba.
1696
+ Yo quise darle una soba
1697
+ a ver si la hacía callar,
1698
+ mas pude reflesionar
1699
+ que era malo en aquel punto,
1700
+ y por respeto al dijunto
1701
+ no la quise castigar.
1702
+
1703
+ 218
1704
+ Limpié el facón en los pastos,
1705
+ desaté mi redomón,
1706
+ monté despacio y salí
1707
+ al tranco pa el cañadón.
1708
+
1709
+ 219
1710
+ Después supe que al finao
1711
+ ni siquiera lo velaron,
1712
+ y retobao en un cuero,
1713
+ sin rezarle lo enterraron.
1714
+
1715
+ 220
1716
+ Y dicen que dende entonces,
1717
+ cuando es la noche serena
1718
+ suele verse una luz mala
1719
+ como de alma que anda en pena.
1720
+
1721
+ 221
1722
+ Yo tengo intención a veces,
1723
+ para que no pene tanto,
1724
+ de sacar de allí los güesos
1725
+ y echarlos al camposanto.
1726
+
1727
+
1728
+ VIII - El ser gaucho es un delito.
1729
+
1730
+ 222
1731
+ otra vez en un boliche
1732
+ estaba haciendo la tarde;
1733
+ cayó un gaucho que hacia alarde
1734
+ de guapo y peliador;
1735
+ a la llegada metió
1736
+ el pingo hasta la ramada,
1737
+ y yo sin decirle nada
1738
+ me quedé en el mostrador.
1739
+
1740
+ 223
1741
+ Era un terne de aquel pago
1742
+ que naides lo reprendía,
1743
+ que sus enriedos tenía
1744
+ con el señor comendante;
1745
+ y como era protegido,
1746
+ andaba muy entonao,
1747
+ y a cualquier desgraciao
1748
+ lo llevaba por delante.
1749
+
1750
+ 224
1751
+ ¡Ah pobre! Si él mismo creiba
1752
+ que la vida le sobraba;
1753
+ ninguno diría que andaba
1754
+ aguaitándolo la muerte.
1755
+ Pero ansí pasa en el mundo,
1756
+ es ansí la triste vida:
1757
+ pa todos está escondida
1758
+ la güena o la mala suerte.
1759
+
1760
+ 225
1761
+ Se tiró al suelo; al dentrar
1762
+ le dio un empellón a un vasco,
1763
+ y me alargó un medio frasco
1764
+ diciendo: beba cuñao.
1765
+ Por su hermana, contesté.
1766
+ Que por la mía no hay cuidao.
1767
+
1768
+ 226
1769
+ ¡Ah, gaucho!, Me respondió;
1770
+ ¿de que pago será crioyo?
1771
+ ¿Lo andará buscando el hoyo?
1772
+ Deberá tener güen cuero;
1773
+ pero ande bala este toro
1774
+ no bala ningún ternero.
1775
+
1776
+ 227
1777
+ Y ya salimos trenzaos
1778
+ porque el hombre no era lerdo,
1779
+ mas como el tino no pierdo,
1780
+ y soy medio ligerón,
1781
+ le dejé mostrando el sebo
1782
+ de un revés con el facón.
1783
+
1784
+ 228
1785
+ Y como con la justicia
1786
+ no andaba bien por allí,
1787
+ cuanto pataliar lo vi,
1788
+ y el pulpero pegó el grito,
1789
+ ya pa el palenque salí
1790
+ como haciéndome chiquito.
1791
+
1792
+ 229
1793
+ Monté y me encomendé a Dios,
1794
+ rumbiando para otro pago,
1795
+ que el gaucho que llaman vago
1796
+ no puede tener querencia,
1797
+ y ansí de estrago en estrago
1798
+ vive llorando la ausencia.
1799
+
1800
+ 230
1801
+ éL andaba siempre juyendo,
1802
+ siempre pobre y perseguido,
1803
+ no tiene cueva ni nido
1804
+ como si juera maldito;
1805
+ porque el ser gaucho- ¡barajo!,
1806
+ El ser gaucho es un delito.
1807
+
1808
+ 231
1809
+ Es como el patrio de posta;
1810
+ lo larga éste, aquél lo toma,
1811
+ nunca se acaba la broma;
1812
+ dende chico se parece
1813
+ al arbolito que crece
1814
+ desamparao en la loma.
1815
+
1816
+ 232
1817
+ Le echan la agua del bautismo
1818
+ aquél que nació en la selva;
1819
+ busca madre que te envuelva,
1820
+ le dice el fraire y lo larga.
1821
+ Y dentra a cruzar el mundo
1822
+ como burro con la carga.
1823
+
1824
+ 233
1825
+ Y se cría viviendo al viento
1826
+ como oveja sin trasquila;
1827
+ mientras su padre en las filas
1828
+ anda sirviendo al gobierno,
1829
+ aunque tirite en invierno,
1830
+ naides lo ampara ni asila.
1831
+
1832
+ 234
1833
+ Le llaman gaucho mamao
1834
+ si lo pillan divertido,
1835
+ y que es mal entretenido
1836
+ si en un baile lo sorprienden;
1837
+ hace mal si se defiende
1838
+ y si no, se ve- fundido.
1839
+
1840
+ 235
1841
+ No tiene hijos ni mujer,
1842
+ ni amigos ni protetores,
1843
+ pues todos son sus señores
1844
+ sin que ninguno lo ampare:
1845
+ tiene la suerte del güey,
1846
+ y ¿donde irá el güey que no are?
1847
+
1848
+ 236
1849
+ Su casa es el pajonal,
1850
+ su guarida es el desierto;
1851
+ y si de hambre medio muerto
1852
+ le echa el lazo a algún mamón,
1853
+ lo persiguen como a plaito,
1854
+ porque es un gaucho ladrón.
1855
+
1856
+ 237
1857
+ Y si de un golpe por ahi
1858
+ lo dan güelta panza arriba,
1859
+ no hay un alma compasiva
1860
+ que le rece una oración;
1861
+ tal vez como cimarrón
1862
+ en una cueva lo tiran.
1863
+
1864
+ 238
1865
+ Él nada gana en la paz
1866
+ y es el primero en la guerra;
1867
+ no le perdonan si yerra,
1868
+ que no saben perdonar,
1869
+ porque el gaucho en esta tierra
1870
+ sólo sirve pa votar.
1871
+
1872
+ 239
1873
+ Para el son los calabozos,
1874
+ para el las duras prisiones,
1875
+ en su boca no hay razones
1876
+ aunque la razón le sobre;
1877
+ que son campanas de palo
1878
+ las razones de los pobres.
1879
+
1880
+ 240
1881
+ Si uno aguanta, es gaucho bruto;
1882
+ si no aguanta es gaucho malo.
1883
+ ¡Dele azote, dele palo,
1884
+ porque es lo que él necesita!
1885
+ De todo el que nació gaucho
1886
+ ésta es la suerte maldita.
1887
+
1888
+ 241
1889
+ Vamos suerte, vamos juntos
1890
+ dende que juntos nacimos;
1891
+ y ya que juntos vivimos
1892
+ sin podernos dividir-
1893
+ yo abriré con mi cuchillo
1894
+ el camino pa seguir
1895
+
1896
+
1897
+ IX - Matreriando. La lucha con la partida.
1898
+
1899
+ 242
1900
+ matreriando lo pasaba
1901
+ ya a las casas no venía;
1902
+ solía arrimarme de día,
1903
+ mas, lo mesmos que el carancho,
1904
+ siempre estaba sobre el rancho
1905
+ espiando a la polecía.
1906
+
1907
+ 243
1908
+ Viva el gaucho que ande mal,
1909
+ como zorro perseguido,
1910
+ hasta que al menor descuido
1911
+ se lo atarasquen los perros,
1912
+ pues nunca le falta un yerro
1913
+ al hombre más alvertido.
1914
+
1915
+ 244
1916
+ Y en esa hora de la tarde
1917
+ en que tuito se adormece,
1918
+ que el mundo dentrar parece
1919
+ a vivir en pura calma,
1920
+ con las tristezas del alma
1921
+ al pajonal enderiece.
1922
+
1923
+ 245
1924
+ Bala el tierno corderito
1925
+ al lao de la blanca oveja,
1926
+ y a la vaca que se aleja
1927
+ llama el ternero amarrao;
1928
+ pero el gaucho desgraciao
1929
+ no tiene a quien dar su oveja.
1930
+
1931
+ 246
1932
+ Ansí es que al venir la noche
1933
+ iba a buscar mi guarida,
1934
+ pues ande el tigre se anida
1935
+ también el hombre lo pasa,
1936
+ y no quería que en las casas
1937
+ me rodiara la partida.
1938
+
1939
+ 247
1940
+ Pues aun cuando vengan ellos
1941
+ cumpliendo con su deberes,
1942
+ yo tengo otros pareceres,
1943
+ y en esa conduta vivo:
1944
+ que no debe un gaucho altivo
1945
+ peliar entre las mujeres.
1946
+
1947
+ 248
1948
+ Y al campo me iba solito,
1949
+ más matrero que el venao,
1950
+ como perro abandonao
1951
+ a buscar una tapera,
1952
+ o en alguna vizcachera
1953
+ pasar la noche tirao.
1954
+
1955
+ 249
1956
+ Sin punto ni rumbo fijo
1957
+ en aquella inmensidá,
1958
+ entre tanta escuridá
1959
+ anda el gaucho como duende;
1960
+ allí jamás lo sorpriende
1961
+ dormido, la autoridá.
1962
+
1963
+ 250
1964
+ Su esperanza es el coraje,
1965
+ su guardia es la precaución,
1966
+ su pingo es la salvación,
1967
+ y pasa uno en su desvelo,
1968
+ sin más amparo que el cielo
1969
+ ni otro amigo que el facón.
1970
+
1971
+ 251
1972
+ Ansí me hallaba una noche
1973
+ contemplando las estrellas,
1974
+ que le parecen más bellas
1975
+ cuanto uno es más desgraciao,
1976
+ y que Dios las haiga criao
1977
+ para consolarse en ellas.
1978
+
1979
+ 252
1980
+ Les tiene el hombre cariño
1981
+ y siempre con alegría
1982
+ ve salir las tres marías;
1983
+ que si llueve, cuanto escampa,
1984
+ las estrellas son la guía
1985
+ que el gaucho tiene en la pampa.
1986
+
1987
+ 253
1988
+ Aquí no valen dotores,
1989
+ sólo vale la esperiencia;
1990
+ aquí verían su inocencia
1991
+ ésos que todo lo saben,
1992
+ porque esto tiene otra llave
1993
+ y el gaucho tiene su cencia.
1994
+
1995
+ 254
1996
+ Es triste en medio del campo
1997
+ pasarse noches enteras
1998
+ contemplando en sus carreras
1999
+ las estrellas que Dios cría,
2000
+ sin tener más compañía
2001
+ que su delito y las fieras.
2002
+
2003
+ 255
2004
+ Me encontraba como digo,
2005
+ en aquella soledá,
2006
+ entre tanta escuridá,
2007
+ echando al viento mis quejas,
2008
+ cuando el grito del chajá
2009
+ me hizo parar las orejas.
2010
+
2011
+ 256
2012
+ Como lumbriz me pegué
2013
+ al suelo para escuchar;
2014
+ pronto sentí retumbar
2015
+ las pisadas de los fletes,
2016
+ y que eran muchos jinetes
2017
+ conocí sin vacilar.
2018
+
2019
+ 257
2020
+ Cuando el hombre está en peligro
2021
+ no debe tener confianza;
2022
+ ansí tendido de panza
2023
+ puse toda mi atención
2024
+ y ya escuché sin tardanza
2025
+ como el ruido de un latón.
2026
+
2027
+ 258
2028
+ Se venían tan calladitos
2029
+ que yo me puse en cuidao;
2030
+ tal vez me hubieran bombiao
2031
+ y ya me venían a buscar;
2032
+ mas no quise disparar,
2033
+ que eso es de gaucho morao.
2034
+
2035
+ 259
2036
+ Al punto me santigüé
2037
+ y eché de giñebra un taco;
2038
+ lo mesmito que el mataco
2039
+ me arroyé con el porrón;
2040
+ si han de darme pa tabaco,
2041
+ dije, ésta es güena ocasión.
2042
+
2043
+ 260
2044
+ Me refalé las espuelas,
2045
+ para no peliar con grillos;
2046
+ me arremangué el calzoncillo,
2047
+ y me ajusté bien la faja,
2048
+ y en una mata de paja
2049
+ probé el filo del cuchillo.
2050
+
2051
+ 261
2052
+ Para tenerlo a la mano
2053
+ el flete en el pasto até,
2054
+ la cincha le acomodé,
2055
+ y, en un trance como aquél,
2056
+ haciendo espaldas en él
2057
+ quietito los aguardé.
2058
+
2059
+ 262
2060
+ Cuando cerca los sentí,
2061
+ y que ahi no más se pararon,
2062
+ los pelos se me erizaron
2063
+ y, aunque nada vían mis ojos,
2064
+ no se han de morir de antojo,
2065
+ les dije, cuando llegaron.
2066
+
2067
+ 263
2068
+ Yo quise hacerles saber
2069
+ que allí se hallaba un varón;
2070
+ les conocí la intención
2071
+ y solamente por eso
2072
+ es que les gané el tirón,
2073
+ sin aguardar voz de preso.
2074
+
2075
+ 264
2076
+ Vos sos un gaucho matrero,
2077
+ dijo uno, haciéndose el güeno.
2078
+ Vos mataste un moreno
2079
+ y otro en una pulpería,
2080
+ y aquí está la polecía
2081
+ que viene a ajustar tus cuentas;
2082
+ te va alzar por las cuarenta
2083
+ si te resistís hoy día.
2084
+
2085
+ 265
2086
+ No me vengan, contesté,
2087
+ con relación de dijuntos;
2088
+ ésos son otros asuntos;
2089
+ vean si me pueden llevar,
2090
+ que yo no me he de entregar,
2091
+ aunque vengan todos juntos.
2092
+
2093
+ 266
2094
+ Pero no aguardaron más
2095
+ y se apiaron en montón;
2096
+ como a perro cimarrón
2097
+ me rodiaron entre tantos;
2098
+ ya me encomendé a los santos,
2099
+ y eché mano a mi facón.
2100
+
2101
+ 267
2102
+ Y ya vide el fogonazo
2103
+ de un tiro de garabina,
2104
+ mas quiso la suerte indina
2105
+ de aquel maula, que me errase,
2106
+ y ahi no más lo levantase
2107
+ lo mesmo que una sardina.
2108
+
2109
+ 268
2110
+ A otro que estaba apurao
2111
+ acomodando una bola,
2112
+ le hice una dentrada sola
2113
+ y le hice sentir el Fierro,
2114
+ y ya salió como el perro
2115
+ cuando le pisan la cola.
2116
+
2117
+ 269
2118
+ Era tanta la aflición
2119
+ y la angurria que venían,
2120
+ que tuitos se me venían,
2121
+ donde yo los esperaba;
2122
+ uno al otro se estorbaba
2123
+ y con las ganas no vían.
2124
+
2125
+ 270
2126
+ Dos de ellos que traiban sables
2127
+ más garifos y resueltos,
2128
+ en las hilachas envueltos
2129
+ enfrente se me pararon,
2130
+ y a un tiempo me atropellaron
2131
+ lo mesmo que perros sueltos.
2132
+
2133
+ 271
2134
+ Me fui reculando en falso
2135
+ y el poncho adelante eché,
2136
+ y en cuanto le puso el pie
2137
+ uno medio chapetón,
2138
+ de pronto le di un tirón
2139
+ y de espaldas lo largué
2140
+
2141
+ 272
2142
+ al verse sin compañero
2143
+ el otro se sofrenó;
2144
+ entonces le dentré yo,
2145
+ sin dejarlo resollar,
2146
+ pero ya empezó a aflojar
2147
+ y a la pu-n-ta disparó.
2148
+
2149
+ 273
2150
+ Uno que en una tacuara
2151
+ había atao una tijera,
2152
+ se vino como si juera
2153
+ palenque de atar terneros,
2154
+ pero en dos tiros certeros
2155
+ salió aullando campo ajuera.
2156
+
2157
+ 274
2158
+ Por suerte en aquel momento
2159
+ venía coloriando el alba
2160
+ y yo dije: si me salva
2161
+ la virgen en este apuro,
2162
+ en adelante le juro
2163
+ ser más güeno que una malva.
2164
+
2165
+ 275
2166
+ Pegué un brinco y entre todos
2167
+ sin miedo me entreveré;
2168
+ hecho ovillo me quedé
2169
+ y ya me cargó una yunta,
2170
+ y por el suelo la punta
2171
+ de mi facón les jugué.
2172
+
2173
+ 276
2174
+ El más engolosinao
2175
+ se me apió con un hachazo;
2176
+ se lo quité con el brazo;
2177
+ de no, me mata los piojos;
2178
+ y antes de que diera un paso
2179
+ le eché tierra en los dos ojos.
2180
+
2181
+ 277
2182
+ Y mientras se sacudía
2183
+ refregándose la vista,
2184
+ yo me le fui como lista
2185
+ y ahi no más me le afirmé,
2186
+ diciéndole: Dios te asista,
2187
+ y de un revés lo voltié.
2188
+
2189
+ 278
2190
+ Pero en ese punto mesmo
2191
+ sentí que por las costillas
2192
+ un sable me hacía cosquillas
2193
+ y la sangre me heló;
2194
+ dende ese momento yo
2195
+ me salí de mis casillas.
2196
+
2197
+ 279
2198
+ Di para atrás unos pasos
2199
+ hasta que pude hacer pie;
2200
+ por delante me lo eché
2201
+ de punta y tajos a un criollo;
2202
+ metió la pata en un hoyo,
2203
+ y yo al hoyo lo mandé.
2204
+
2205
+ 280
2206
+ Tal vez en el corazón
2207
+ le tocó un santo bendito
2208
+ a un gaucho, que pegó el grito
2209
+ y dijo: ¡Cruz no consiente
2210
+ que se cometa el delito
2211
+ de matar a un valiente!
2212
+
2213
+ 281
2214
+ Y ahi no más se me aparió,
2215
+ dentrándole a la partida;
2216
+ yo les hice otra embestida
2217
+ pues entre dos era robo;
2218
+ y el Cruz era como lobo
2219
+ que defiende su guarida.
2220
+
2221
+ 282
2222
+ Uno despachó al infierno
2223
+ de dos que lo atropellaron;
2224
+ los demás remoliniaron,
2225
+ pues íbamos a la fija,
2226
+ y a poco andar dispararon
2227
+ lo mesmo que sabandija.
2228
+
2229
+ 283
2230
+ Ahí quedaron largo a largo
2231
+ los que estiaron la jeta;
2232
+ otro iba como maleta,
2233
+ y Cruz de atrás les decía:
2234
+ que venga otra polecía
2235
+ a llevarlos en carreta.
2236
+
2237
+ 284
2238
+ Yo junté las osamentas,
2239
+ me hinqué y les recé un bendito,
2240
+ hice una cruz de un palito
2241
+ y pedí a mi Dios clemente
2242
+ me perdonara el delito
2243
+ de haber muerto tanta gente.
2244
+
2245
+ 285
2246
+ Dejamos amotonaos
2247
+ a los pobres que murieron;
2248
+ no sé si los recogieron,
2249
+ porque nos fuimos a un rancho,
2250
+ o si tal vez los caranchos
2251
+ ahi no más se los comieron.
2252
+
2253
+ 286
2254
+ Lo agarramos mano a mano
2255
+ entre los dos al porrón:
2256
+ en semejante ocasión
2257
+ un trago a cualquiera encanta;
2258
+ y Cruz no era remolón
2259
+ ni pijotiaba garganta.
2260
+
2261
+ 287
2262
+ Calentamos los gargueros
2263
+ y nos largamos muy tiesos,
2264
+ siguiendo siempre los besos
2265
+ al pichel, y por mas señas,
2266
+ íbamos como cigüeñas
2267
+ estirando los pescuezos.
2268
+
2269
+ 288
2270
+ Yo me voy, le dije, amigo,
2271
+ donde la suerte me lleve,
2272
+ y si es que alguno se atreve,
2273
+ a ponerse en mi camino,
2274
+ yo seguiré mi destino,
2275
+ que el hombre hace lo que debe.
2276
+
2277
+ 289
2278
+ Soy un gaucho desgraciao,
2279
+ no tengo donde ampararme,
2280
+ ni un palo donde rascarme,
2281
+ ni un árbol que me cubije:
2282
+ pero ni aun esto me aflige
2283
+ porque yo sé manejarme.
2284
+
2285
+ 290
2286
+ Antes de cair al servicio,
2287
+ tenia familia y hacienda;
2288
+ cuando volví, ni la prenda
2289
+ me la habían dejao ya.
2290
+ Dios sabe en lo que vendrá
2291
+ a parar esta contienda.
2292
+
2293
+
2294
+ X - Por culpa de una mujer.
2295
+
2296
+ 291
2297
+ amigazo, pa sufrir
2298
+ han nacido los varones;
2299
+ estas son las ocasiones
2300
+ de mostrarse un hombre juerte,
2301
+ hasta que venga la muerte
2302
+ y lo agarre a coscorrones.
2303
+
2304
+ 292
2305
+ El andar tan despilchao
2306
+ ningún mérito me quita;
2307
+ sin ser un alma bendita
2308
+ me duelo del mal ajeno:
2309
+ soy un pastel con relleno
2310
+ que parece torta frita.
2311
+
2312
+ 293
2313
+ Tampoco me faltan males
2314
+ y desgracias, le prevengo;
2315
+ también mis desdichas tengo,
2316
+ aunque esto poco me aflige:
2317
+ yo sé hacerme el chango rengo
2318
+ cuando la cosa lo esige.
2319
+
2320
+ 294
2321
+ Y con algunos ardiles
2322
+ voy viviendo, aunque rotoso;
2323
+ a veces me hago el sarnoso
2324
+ y no tengo ni un granito,
2325
+ pero al chifle voy ganoso
2326
+ como panzón al maíz frito.
2327
+
2328
+ 295
2329
+ A mí no me matan penas
2330
+ mientras tenga el cuero sano;
2331
+ venga el sol en el verano
2332
+ y la escarcha en el invierno
2333
+ ¿por qué afligirse el cristiano?
2334
+
2335
+ 296
2336
+ Hagámosle cara fiera
2337
+ a los males, compañero,
2338
+ porque el zorro más matrero
2339
+ suele cair como un chorlito;
2340
+ viene por un corderito
2341
+ y en la estaca deja el cuero.
2342
+
2343
+ 297
2344
+ Hoy tenemos que sufrir
2345
+ males que no tienen nombre,
2346
+ pero esto a nadies lo asombre
2347
+ porque ansina es el pastel,
2348
+ y tiene que dar el hombre
2349
+ mas güeltas que un carretel.
2350
+
2351
+ 298
2352
+ Yo nunca me he de entregar
2353
+ a los brazos de la muerte;
2354
+ arrastro mi triste suerte
2355
+ paso a paso y como pueda,
2356
+ que donde el débil se queda
2357
+ se suele escapar el juerte.
2358
+
2359
+ 299
2360
+ Y ricuerde cada cual
2361
+ lo que cada cual sufrió,
2362
+ que lo que es, amigo, yo,
2363
+ hago ansí la cuenta mía:
2364
+ ya lo pasado pasó;
2365
+ mañana será otro día.
2366
+
2367
+ 300
2368
+ Yo también tuve una pilcha
2369
+ que me enllenó el corazón,
2370
+ y si en aquella ocasión
2371
+ alguien me hubiera buscao,
2372
+ siguro que me había hallao
2373
+ más prendido que un botón.
2374
+
2375
+ 301
2376
+ En la güeya del querer
2377
+ no hay animal que se pierda-
2378
+ las mujeres no son lerdas,
2379
+ y todo gaucho es dotor
2380
+ si pa cantarle al amor
2381
+ tiene que templar las cuerdas.
2382
+
2383
+ 302
2384
+ ¡Quién es de una alma tan dura
2385
+ que no quiera una mujer!
2386
+ Lo alivia en su padecer:
2387
+ si no sale calavera
2388
+ es la mejor compañera
2389
+ que el hombre puede tener.
2390
+
2391
+ 303
2392
+ Si es güena, no lo abandona
2393
+ cuando lo ve desgraciao,
2394
+ lo asiste con su cuidao,
2395
+ y con afán cariñoso,
2396
+ y usté tal vez ni un rebozo
2397
+ ni una pollera le ha dao.
2398
+
2399
+ 304
2400
+ ¡Grandemente lo pasaba
2401
+ con aquella prenda mía,
2402
+ viviendo con alegría
2403
+ como la mosca en la miel!
2404
+ ¡Amigo, qué tiempo aquel!
2405
+ ¡La pucha, que la quería!
2406
+
2407
+ 305
2408
+ Era la águila que a un árbol
2409
+ dende las nubes bajó;
2410
+ era más linda que el alba
2411
+ cuando va rayando el sol;
2412
+ era la flor deliciosa
2413
+ que entre el trebolar creció.
2414
+
2415
+ 306
2416
+ Pero, amigo, el comendante
2417
+ que mandaba la milicia,
2418
+ como que no desperdicia
2419
+ se fue refalando a casa;
2420
+ yo le conocí en la traza
2421
+ que el hombre traiba malicia.
2422
+
2423
+ 307
2424
+ Él me daba voz de amigo,
2425
+ pero no le tenía fe;
2426
+ era el jefe, y ya se ve,
2427
+ no podía competir yo;
2428
+ en mi rancho se pegó
2429
+ lo mesmo que un saguaipé.
2430
+
2431
+ 308
2432
+ A poco andar, conocí
2433
+ que ya me había desbancao,
2434
+ y él siempre muy entonao,
2435
+ aunque sin darme ni un cobre,
2436
+ me tenía de lao a lao
2437
+ como encomienda de pobre.
2438
+
2439
+ 309
2440
+ A cada rato, de chasque
2441
+ me hacía dir a gran distancia;
2442
+ ya me mandaba a una estancia,
2443
+ ya al pueblo, ya a la frontera;
2444
+ pero él en la comendancia
2445
+ no ponía los pies siquiera.
2446
+
2447
+ 310
2448
+ Es triste a no poder más
2449
+ el hombre en su padecer,
2450
+ si no tiene una mujer
2451
+ que lo ampare y lo consuele:
2452
+ mas pa que otro se la pele
2453
+ lo mejor es no tener.
2454
+
2455
+ 311
2456
+ No me gusta que otro gallo
2457
+ le cacaree a mi gallina;
2458
+ yo andaba ya con la espina,
2459
+ hasta que en una ocasión
2460
+ lo pille junto al jogón
2461
+ abrazándome a la china.
2462
+
2463
+ 312
2464
+ Tenía el viejito una cara
2465
+ de ternero mal lamido,
2466
+ y al verle tan atrevido
2467
+ le dije: ¡que le aproveche!-
2468
+ Que había sido pa el amor
2469
+ como gaucho pa la leche.
2470
+
2471
+ 313
2472
+ Peló la espalda y se vino
2473
+ como a quererme ensartar,
2474
+ pero yo sin tutubiar
2475
+ le volví al punto a decir:
2476
+ ¡cuidado!, No te vas a per-tigo;
2477
+ poné cuarta pa salir.
2478
+
2479
+ 314
2480
+ Un puntazo me largó,
2481
+ pero el cuerpo le saqué,
2482
+ y en cuanto se lo quité,
2483
+ para no matar un viejo,
2484
+ con cuidado, medio de lejos
2485
+ un palazo le asenté.
2486
+
2487
+ 315
2488
+ Y como nunca al que manda
2489
+ le falta algún adulón,
2490
+ uno que en esa ocasión
2491
+ se encontraba allí presente,
2492
+ vino apretando los dientes
2493
+ como perrito mamón.
2494
+
2495
+ 316
2496
+ Me hizo un tiro de revuélver
2497
+ que el hombre creyó siguro;
2498
+ era confiado y le juro
2499
+ que cerquita se arrimaba,
2500
+ pero, siempre en un apuro
2501
+ se desentumen mis tabas.
2502
+
2503
+ 317
2504
+ Él me siguió menudiando
2505
+ mas sin poderme acertar,
2506
+ y yo, dele culebriar,
2507
+ hasta que al fin le dentré
2508
+ y ahi no más lo despaché
2509
+ sin dejarlo resollar.
2510
+
2511
+ 318
2512
+ Dentré a campiar en seguida
2513
+ al viejito enamorao-
2514
+ el pobre se había ganao
2515
+ en un noque de lejía.
2516
+ ¡Quién sabe cómo estaría
2517
+ del susto que había llevao!
2518
+
2519
+ 319
2520
+ ¡Es zonzo el cristiano macho
2521
+ cuando el amor lo domina!
2522
+ Él la miraba a la indina,
2523
+ y una cosa tan jedionda
2524
+ sentí yo, que ni en la fonda
2525
+ he visto tal jedentina
2526
+
2527
+ 320
2528
+ Y le dije: pa su agüela
2529
+ han de ser esas perdices.
2530
+ Yo me tapé las narices,
2531
+ y me salí esternudando,
2532
+ y el viejo quedó olfatiando
2533
+ como chico con lumbrices.
2534
+
2535
+ 321
2536
+ Cuando la mula recula,
2537
+ señal que quiere cociar,
2538
+ ansí se suele portar
2539
+ aunque ella lo disimula;
2540
+ recula como la mula
2541
+ la mujer, para olvidar.
2542
+
2543
+ 322
2544
+ Alcé mis ponchos y mis prendas
2545
+ y me largué a padecer
2546
+ por culpa de una mujer
2547
+ que quiso engañar a dos;
2548
+ al rancho le dije adiós,
2549
+ para nunca más volver.
2550
+
2551
+ 323
2552
+ Las mujeres, dende entonces,
2553
+ conocí a todas en una;
2554
+ ya no he de probar fortuna
2555
+ con carta tan conocida:
2556
+ mujer y perra parida,
2557
+ ¡no se me acerca ninguna!.
2558
+
2559
+
2560
+ XI - A bailar un pericón.
2561
+
2562
+ 324
2563
+ a otros les brotan las coplas
2564
+ como agua de manantial;
2565
+ pues a mí me pasa igual;
2566
+ aunque las mías nada valen,
2567
+ de la boca se me salen
2568
+ como ovejas de corral.
2569
+
2570
+ 325
2571
+ Que en puertiando la primera,
2572
+ ya la siguen los demás,
2573
+ y en montones las de atrás
2574
+ contra los palos se estrellan,
2575
+ y saltan y se atropellan
2576
+ sin que se corten jamás.
2577
+
2578
+ 326
2579
+ Y aunque yo por mi inorancia
2580
+ con gran trabajo me esplico,
2581
+ cuando llego a abrir el pico,
2582
+ tengaló por cosa cierta,
2583
+ sale un verso y en la puerta
2584
+ ya asoma el otro el hocico.
2585
+
2586
+ 327
2587
+ Y emprésteme su atención;
2588
+ me oirá relatar las penas
2589
+ de que traigo la alma llena;
2590
+ porque en toda circustancia,
2591
+ paga el gaucho su inorancia
2592
+ con la sangre de sus venas.
2593
+
2594
+ 328
2595
+ Después de aquella desgracia
2596
+ me refugié en los pajales;
2597
+ anduve entre los cardales
2598
+ como bicho sin guarida;
2599
+ pero, amigo, es esa vida
2600
+ como vida de animales.
2601
+
2602
+ 329
2603
+ Y son tantas las miserias
2604
+ en que me he salido ver,
2605
+ que con tanto padecer
2606
+ y sufrir tanta aflición,
2607
+ malicio que he de tener
2608
+ un callo en el corazón.
2609
+
2610
+ 330
2611
+ Ansí andaba como guacho
2612
+ cuando pasa el temporal;
2613
+ supe una vez por mi mal
2614
+ de una milonga que había,
2615
+ y ya pa la pulpería
2616
+ enderecé mi bagual.
2617
+
2618
+ 331
2619
+ Era la casa del baile
2620
+ un rancho de mala muerte,
2621
+ y se enllenó de tal suerte
2622
+ que andábamos a empujones:
2623
+ nunca faltan encontrones
2624
+ cuando un pobre se divierte.
2625
+
2626
+ 332
2627
+ Yo tenía unas medias botas
2628
+ con tamaños verdugones;
2629
+ me pusieron los talones
2630
+ con crestas como gallos:
2631
+ ¡si viera mis afliciones
2632
+ pensando yo que eran callos!
2633
+
2634
+ 333
2635
+ Con gato y con fandanguillo
2636
+ había empezado el changango,
2637
+ y para ver el fandango
2638
+ me colé haciendomé bola,
2639
+ mas metió el diablo la cola,
2640
+ y todo se volvió pango.
2641
+
2642
+ 334
2643
+ Había sido el guitarrero
2644
+ un gaucho duro de boca:
2645
+ yo tengo paciencia poca
2646
+ pa aguantar cuando no debo;
2647
+ a ninguno me le atrevo,
2648
+ pero me halla el que me toca.
2649
+ 335
2650
+ A bailar un pericón
2651
+ con una moza salí,
2652
+ y cuanto me vido allí
2653
+ sin duda me conoció;
2654
+ y estas coplitas cantó
2655
+ como por raírse de mí:
2656
+
2657
+ 336
2658
+ las mujeres son todas
2659
+ como las mulas;
2660
+ yo no digo que todas,
2661
+ pero hay algunas
2662
+ que a las aves que vuelan
2663
+ les sacan plumas.
2664
+
2665
+ 337
2666
+ Hay gauchos que presumen
2667
+ de tener damas;
2668
+ no digo que presumen,
2669
+ pero se alaban,
2670
+ y a lo mejor los dejan
2671
+ tocando tablas.
2672
+
2673
+ 338
2674
+ Se secretiaron las hembras,
2675
+ y yo ya me encocoré;
2676
+ volié la anca y le grité:
2677
+ ¡dejá de cantar- chicharra!
2678
+ Y de un tajo a la guitarra
2679
+ tuitas las cuerdas corté.
2680
+
2681
+ 339
2682
+ Al punto salió de adentro
2683
+ un gringo con un jusil;
2684
+ pero nunca he sido vil,
2685
+ poco el peligro me espanta;
2686
+ yo me refalé la manta
2687
+ y la eché sobre el candil.
2688
+
2689
+ 340
2690
+ Gané en seguida la puerta
2691
+ gritando: ¡nadies me ataje!
2692
+ Y alborotado el hembraje,
2693
+ lo que todo quedo escuro,
2694
+ empezó a verse en apuro
2695
+ mesturao con el gauchaje.
2696
+
2697
+ 341
2698
+ El primero que salió
2699
+ fue el cantor, y se me vino;
2700
+ pero yo no pierdo el tino
2701
+ aunque haiga tomao un trago,
2702
+ y hay algunos por mi pago
2703
+ que me tienen por ladino.
2704
+
2705
+ 342
2706
+ No ha de haber achocao otro:
2707
+ le salió cara la broma;
2708
+ a su amigo cuando toma
2709
+ se le despeja el sentido,
2710
+ y el pobrecito había sido
2711
+ como carne de paloma.
2712
+
2713
+ 343
2714
+ Para prestar un socorro
2715
+ las mujeres no son lerdas:
2716
+ antes que la sangre pierda
2717
+ lo arrimaron a unas pipas;
2718
+ ahi lo dejé con las tripas
2719
+ como pa que hiciera cuerdas.
2720
+
2721
+ 344
2722
+ Monté y me largué a los campos
2723
+ más libre que el pensamiento,
2724
+ como las nubes al viento
2725
+ a vivir sin paradero,
2726
+ que no tiene el que es matrero
2727
+ nido, ni rancho, ni asiento.
2728
+
2729
+ 345
2730
+ No hay juerza contra el destino
2731
+ que le ha señalao el cielo,
2732
+ y aunque no tenga consuelo,
2733
+ ¡aguante el que está en trabajo!
2734
+ ¡Nadies se rasca pa abajo,
2735
+ ni se lonjea contra el pelo!
2736
+
2737
+ 346
2738
+ Con el gaucho desgraciao
2739
+ no hay uno que no se entone
2740
+ ¡la menor falta lo espone
2741
+ a andar con los avestruces
2742
+ faltan otros con más luces
2743
+ y siempre hay quien los perdone.
2744
+
2745
+
2746
+ XII - Ansí estuve en la partida.
2747
+
2748
+ 347
2749
+ Yo no sé qué tantos meses
2750
+ esta vida me duró;
2751
+ a veces nos obligó
2752
+ la miseria a comer potro:
2753
+ me había acompañao con otros
2754
+ tan desgraciaos como yo
2755
+
2756
+ 348
2757
+ Mas ¿para qué platicar
2758
+ sobre esos males, canejos?
2759
+ Nace el gaucho y se hace viejo,
2760
+ sin que mejore su suerte,
2761
+ hasta que por ahi la muerte
2762
+ sale a cobrarle el pellejo.
2763
+
2764
+ 349
2765
+ Pero como no hay desgracia
2766
+ que no acabe alguna vez,
2767
+ me aconteció que después
2768
+ de sufrir tanto rigor,
2769
+ un amigo, por favor,
2770
+ me compuso con el juez.
2771
+
2772
+ 350
2773
+ Le alvertiré que en mi pago
2774
+ ya no va quedando un criollo:
2775
+ se los ha tragao el hoyo,
2776
+ o juido o muerto en la guerra;
2777
+ porque, amigo, en esta tierra
2778
+ nunca se acaba el embrollo.
2779
+
2780
+ 351
2781
+ Colijo que jué por eso
2782
+ que me llamó el juez un día,
2783
+ y me dijo que quería
2784
+ hacerme a su lao venir,
2785
+ y que dentrase a servir
2786
+ de soldao de polecía.
2787
+
2788
+ 352
2789
+ Y me largó una proclama
2790
+ tratándome de valiente;
2791
+ que yo era un hombre decente,
2792
+ y que dende aquel momento
2793
+ me nombraba de sargento
2794
+ pa que mandara la gente.
2795
+
2796
+ 353
2797
+ Ansí estuve en la partida,
2798
+ pero ¿qué había de mandar?
2799
+ Anoche al irlo a tomar
2800
+ vide güena coyontura,
2801
+ y a mí no me gusta andar
2802
+ con la lata a la cintura.
2803
+
2804
+ 354
2805
+ Ya conoce, pues, quién soy;
2806
+ tenga confianza conmigo:
2807
+ Cruz le dio mano de amigo,
2808
+ y no lo ha de abandonar;
2809
+ juntos podemos buscar
2810
+ pa los dos un mesmo abrigo.
2811
+
2812
+ 355
2813
+ Andaremos de matreros
2814
+ si es preciso pa salvar;
2815
+ nunca nos ha de faltar
2816
+ ni un güen pingo pa juir,
2817
+ ni un pajal ande dormir,
2818
+ ni un matambre que ensartar.
2819
+
2820
+ 356
2821
+ Y cuando sin trapo alguno
2822
+ nos haiga el tiempo dejao,
2823
+ yo le pediré emprestao
2824
+ el cuero a cualquiera lobo,
2825
+ y hago un poncho, si lo sobo,
2826
+ mejor que poncho engomao.
2827
+
2828
+ 357
2829
+ Para mí la cola es pecho
2830
+ y el espinazo es cadera
2831
+ hago mi nido ande quiera
2832
+ y de lo que encuentro como;
2833
+ me echo tierra sobre el lomo
2834
+ y me apeo en cualquier tranquera.
2835
+
2836
+ 358
2837
+ Y dejo rodar la bola,
2838
+ que algún día se ha de parar-
2839
+ tiene el gaucho que aguantar
2840
+ hasta que lo trague el hoyo,
2841
+ o hasta que venga algún criollo
2842
+ en esta tierra a mandar.
2843
+
2844
+ 362
2845
+ Todos se güelven proyetos
2846
+ de colonias y carriles,
2847
+ y tirar la plata a miles
2848
+ en los gringos enganchaos,
2849
+ mientras al pobre soldao
2850
+ le pelan la cucha- ¡ah, viles!
2851
+
2852
+ 363
2853
+ Pero si siguen las cosas
2854
+ como van hasta el presente,
2855
+ puede ser que redepente
2856
+ veamos el campo disierto,
2857
+ y blanquiando solamente
2858
+ los güesos de los que han muerto.
2859
+
2860
+ 359
2861
+ Lo miran al pobre gaucho
2862
+ como carne de cogote:
2863
+ lo tratan al estricote
2864
+ y si ansí las cosas andan,
2865
+ porque quieren los que mandan,
2866
+ aguantemos los azotes.
2867
+
2868
+ 360
2869
+ ¡Pucha! Si usté los oyera,
2870
+ como yo en una ocasión
2871
+ tuita la conversación
2872
+ que con otro tuvo el juez;
2873
+ le asiguro que esa vez
2874
+ se me achicó el corazón.
2875
+
2876
+ 361
2877
+ Hablaban de hacerse ricos
2878
+ con campos en la fronteras,
2879
+ de sacarla más ajuera,
2880
+ donde había campos baldidos
2881
+ y llevar de los partidos
2882
+ gente que la defendiera.
2883
+
2884
+ 364
2885
+ Hace mucho que sufrimos
2886
+ la suerte reculativa
2887
+ trabaja el gaucho y no arriba
2888
+ porque a lo mejor del caso,
2889
+ lo levantan de un sogazo
2890
+ sin dejarle ni saliva.
2891
+
2892
+ 365
2893
+ De los males que sufrimos
2894
+ hablan mucho los puebleros,
2895
+ pero hacen como los teros
2896
+ para esconder sus niditos:
2897
+ en un lao pegan los gritos
2898
+ y en otro tienen los güevos.
2899
+
2900
+ 366
2901
+ Y se hacen los que no aciertan
2902
+ a dar con la coyontura:
2903
+ mientras al gaucho lo apura
2904
+ con rigor la autoridá,
2905
+ ellos a la enfermedá
2906
+ le están errando la cura.
2907
+
data/martin-fierro_validation.txt ADDED
@@ -0,0 +1,234 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ XIII. A los indios me refalo
2
+
3
+ 367
4
+ ya veo que somos los dos
5
+ astillas del mesmo palo:
6
+ yo paso por gaucho malo
7
+ y usté anda del mesmo modo;
8
+ y yo, pa acabarlo todo,
9
+ a los indios me refalo.
10
+
11
+ 368
12
+ Pido perdón a mi Dios
13
+ que tantos bienes me hizo,
14
+ pero dende que es preciso
15
+ que viva entre los infeles,
16
+ yo seré cruel con los crueles:
17
+ ansí mi suerte lo quiso.
18
+
19
+ 369
20
+ Dios formó lindas las flores,
21
+ delicadas como son;
22
+ le dio toda perfeción
23
+ y cuanto él era capaz,
24
+ pero al hombre le dio más
25
+ cuando le dio el corazón.
26
+
27
+ 370
28
+ Le dio claridá a la luz,
29
+ juerza en su carrera al viento,
30
+ le dio vida y movimiento
31
+ dende la águila al gusano;
32
+ pero más le dio al cristiano
33
+ al darle el entendimiento.
34
+
35
+ 371
36
+ Y aunque a las aves les dio,
37
+ con otras cosas que inoro,
38
+ esos piquitos como oro
39
+ y un plumaje como tabla
40
+ le dio al hombre más tesoro
41
+ al darle una lengua que habla.
42
+
43
+ 372
44
+ Y dende que dio a las fieras
45
+ esa juria tan inmensa,
46
+ que no hay poder que las venza
47
+ ni nada que las asombre,
48
+ ¿qué menos le daría al hombre
49
+ que el valor pa su defensa?
50
+
51
+ 373
52
+ Pero tantos bienes juntos
53
+ al darle, malicio yo
54
+ que en sus adentros pensó
55
+ que el hombre los precisaba
56
+ que los bienes igualaba
57
+ con las penas que le dio.
58
+
59
+ 374
60
+ Y yo empujao por las mías
61
+ quiero salir de este infierno:
62
+ ya no soy pichón muy tierno
63
+ y sé manejar la lanza,
64
+ y hasta los indios no alcanza
65
+ la facultá de gobierno
66
+
67
+ 375
68
+ yo sé que allá los caciques
69
+ amparan a los cristianos,
70
+ y que los tratan de
71
+ cuando se van por su gusto.
72
+ ¡A qué andar pasando sustos-!
73
+ Alcemos el poncho y vamos.
74
+
75
+ 376
76
+ En la cruzada hay peligros,
77
+ pero ni aun esto me aterra:
78
+ yo ruedo sobre la tierra
79
+ arrastrao por mi destino;
80
+ y si erramos el camino-
81
+ no es el primero que lo erra.
82
+
83
+ 377
84
+ Si hemos de salvar o no,
85
+ de esto naides nos responde;
86
+ derecho ande el sol se esconde
87
+ tierra adentro hay que tirar;
88
+ algún día hemos de llegar-
89
+ después sabremos a dónde.
90
+
91
+ 378
92
+ No hemos de perder el rumbo:
93
+ los dos somos güena yunta.
94
+ El que es gaucho ve ande apunta
95
+ aunque inora ande se encuentra;
96
+ pa el lao en que el sol se dentra
97
+ dueblan los pastos la punta.
98
+
99
+ 379
100
+ De hambre no pereceremos,
101
+ pues, sigún otros me han dicho,
102
+ en los campos se hallan bichos
103
+ de los que uno necesita-
104
+ gamas, matacos, mulitas
105
+ avestruces y quirquinchos.
106
+
107
+ 380
108
+ Cuando se anda en el desierto
109
+ se come uno hasta las colas;
110
+ lo han cruzao mujeres solas
111
+ llegando al fin con salú,
112
+ y ha de ser gaucho el ñandú
113
+ que se escape de mis bolas.
114
+
115
+ 381
116
+ Tampoco a la sé le temo;
117
+ yo la aguanto muy contento;
118
+ busco agua olfatiando el viento
119
+ y, dende que no soy manco,
120
+ ande hay duraznillo blanco
121
+ cavo, y la saco al momento.
122
+
123
+ 382
124
+ Allá habrá siguridá
125
+ ya que aquí no la tenemos;
126
+ menos males pasaremos
127
+ y ha de haber grande alegría
128
+ el día que nos descolguemos
129
+ en alguna toldería.
130
+
131
+ 383
132
+ Fabricaremos un toldo,
133
+ como lo hacen tantos otros,
134
+ con unos cueros de potro,
135
+ que sea sala y sea cocina.
136
+ ¡Tal vez no falte una china
137
+ que se apiade de nosotros!
138
+
139
+ 384
140
+ Allá no hay que trabajar,
141
+ vive uno como un señor;
142
+ de cuando en cuando un malón,
143
+ y si de él sale con vida,
144
+ lo pasa echao panza arriba
145
+ mirando dar güelta el sol
146
+
147
+ 385
148
+ Y ya que a juerza de golpes
149
+ la suerte nos dejó aflús
150
+ puede que allá veamos luz
151
+ y se acaben nuestras penas:
152
+ todas las tierras son güenas;
153
+ vamonós, amigo Cruz.
154
+
155
+ 386
156
+ El que maneja las bolas,
157
+ el que sabe echar un pial
158
+ y sentársele a un bagual
159
+ sin miedo de que lo baje,
160
+ entre los mesmos salvajes
161
+ no puede pasarlo mal.
162
+
163
+ 387
164
+ El amor como la guerra
165
+ lo hace el criollo con canciones;
166
+ a más de eso en los malones
167
+ podemos aviarnos de algo;
168
+ en fin amigo, yo salgo
169
+ de estas pelegrinaciones.
170
+
171
+ 388
172
+ En este punto el cantor
173
+ buscó un porrón pa consuelo,
174
+ echó un trago como un cielo,
175
+ dando fin a su argumento;
176
+ y de un golpe el instrumento
177
+ lo hizo astillas contra el suelo.
178
+
179
+ 389
180
+ Ruempo, dijo, la guitarra,
181
+ pa no volverme a tentar;
182
+ ninguno la ha de tocar,
183
+ por siguro tengaló;
184
+ pues naides ha de cantar
185
+ cuando este gaucho cantó.
186
+
187
+ 390
188
+ Y daré fin a mis coplas
189
+ con aire de relación;
190
+ nunca falta un preguntón
191
+ más curioso que mujer,
192
+ y tal vez quiera saber
193
+ como jué la conclusión.
194
+
195
+ 391
196
+ Cruz y Fierro de una estancia
197
+ una tropilla se arriaron;
198
+ por delante se la echaron
199
+ como criollos entendidos,
200
+ y pronto sin ser sentidos
201
+ por la frontera cruzaron.
202
+
203
+ 392
204
+ Y cuando la habían pasao,
205
+ una madrugada clara
206
+ le dijo Cruz que mirara
207
+ las últimas poblaciones,
208
+ y a Fierro dos lagrimones
209
+ le rodaron por la cara.
210
+
211
+ 393
212
+ Y siguiendo el fiel del rumbo
213
+ se entraron en el desierto,
214
+ no sé si los habrán muerto
215
+ en alguna correría,
216
+ pero espero que algún día
217
+ sabré de ellos algo cierto.
218
+
219
+ 394
220
+ Y ya con estas noticias
221
+ mi relación acabé;
222
+ por ser ciertas las conté,
223
+ todas la desgracias dichas:
224
+ es un telar de desdichas
225
+ cada gaucho que usté ve.
226
+
227
+ 395
228
+ Pero ponga su esperanza
229
+ en el Dios que lo formó;
230
+ y aquí me despido yo
231
+ que he relatao a mi modo
232
+ MALES QUE CONOCEN TODOS,
233
+ PERO QUE NAIDES CONTÓ.
234
+
flisol-cordoba-2023.ipynb ADDED
@@ -0,0 +1,1164 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "65c9fdf3",
6
+ "metadata": {
7
+ "slideshow": {
8
+ "slide_type": "slide"
9
+ }
10
+ },
11
+ "source": [
12
+ "Hugging Face: IA Colaborativa\n",
13
+ "========================="
14
+ ]
15
+ },
16
+ {
17
+ "cell_type": "markdown",
18
+ "id": "32a802c2",
19
+ "metadata": {
20
+ "slideshow": {
21
+ "slide_type": "subslide"
22
+ }
23
+ },
24
+ "source": [
25
+ "¿Quién soy?\n",
26
+ "------------------\n",
27
+ "\n",
28
+ "<div style=\"text-align:center\">\n",
29
+ " <h4 style=\"font-size:1.5em;margin:5px\">Cristian Cardellino</h4>\n",
30
+ " <h5 style=\"font-style:normal;font-size:1em;margin:5px\">Profesor de FAMAFyC (UNC) - Investigador en Mercado Libre</h5>\n",
31
+ " <div style=\"display:inline-block;margin-right:0px;\">\n",
32
+ " <img src=\"./img/me.jpg\" style=\"height:10em;width:auto;\"/>\n",
33
+ " </div>\n",
34
+ " <h6 style=\"font-style:normal;font-size:0.9em;margin:5px;\">\n",
35
+ " <a href=\"https://twitter.com/crscardellino\" style=\"color:royalblue;\" target=\"_blank\">@crscardellino</a> -\n",
36
+ " <a href=\"https://mastodon.social/@crscardellino\" style=\"color:royalblue;\" target=\"_blank\">@crscardellino@mastodon.social</a> -\n",
37
+ " <a href=\"https://crscardellino.ar\" style=\"color:royalblue;\" target=\"_blank\">https://crscardellino.ar</a>\n",
38
+ " </h6>\n",
39
+ "</div>"
40
+ ]
41
+ },
42
+ {
43
+ "cell_type": "markdown",
44
+ "id": "bb685a55",
45
+ "metadata": {
46
+ "slideshow": {
47
+ "slide_type": "subslide"
48
+ }
49
+ },
50
+ "source": [
51
+ "## Esquema de la charla\n",
52
+ "\n",
53
+ "1. [¿Qué hay detrás de ChatGPT?](#¿Qué-hay-detrás-de-ChatGPT?)\n",
54
+ "2. [Hugging Face](#Hugging-Face)\n",
55
+ "3. [Utilizando un modelo de Hugging Face](#Utilizando-un-modelo-de-Hugging-Face)\n",
56
+ "4. [Personalizando un modelo de Hugging Face](#Personalizando-un-modelo-de-Hugging-Face)"
57
+ ]
58
+ },
59
+ {
60
+ "cell_type": "markdown",
61
+ "id": "eb7f3997",
62
+ "metadata": {
63
+ "slideshow": {
64
+ "slide_type": "slide"
65
+ }
66
+ },
67
+ "source": [
68
+ "# ¿Qué hay detrás de ChatGPT?"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "markdown",
73
+ "id": "87d1ca59",
74
+ "metadata": {
75
+ "slideshow": {
76
+ "slide_type": "subslide"
77
+ }
78
+ },
79
+ "source": [
80
+ "## ¿Cómo continúa esta frase?\n",
81
+ "\n",
82
+ "<h2 style=\"text-align:center;font-weight:normal;font-size:1.3em;\">You ...</h2>"
83
+ ]
84
+ },
85
+ {
86
+ "cell_type": "markdown",
87
+ "id": "1e5a5c6b",
88
+ "metadata": {
89
+ "slideshow": {
90
+ "slide_type": "fragment"
91
+ }
92
+ },
93
+ "source": [
94
+ "<h2 style=\"text-align:center;font-weight:normal;font-size:1.3em;\">You shall ...</h2>"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "markdown",
99
+ "id": "f71da59e",
100
+ "metadata": {
101
+ "slideshow": {
102
+ "slide_type": "fragment"
103
+ }
104
+ },
105
+ "source": [
106
+ "<h2 style=\"text-align:center;font-weight:normal;font-size:1.3em;\">You shall not ...</h2>"
107
+ ]
108
+ },
109
+ {
110
+ "cell_type": "markdown",
111
+ "id": "2910e985",
112
+ "metadata": {
113
+ "slideshow": {
114
+ "slide_type": "fragment"
115
+ }
116
+ },
117
+ "source": [
118
+ "<div style=\"text-align:center;\">\n",
119
+ " <h2 style=\"font-weight:normal;font-size:1.3em;\">You shall not pass!</h2>\n",
120
+ " <div style=\"display:inline-block;margin-top:10px;\">\n",
121
+ " <img src=\"./img/gandalf.gif\" style=\"height:10em;width:auto;\"/>\n",
122
+ " </div>\n",
123
+ "</div>"
124
+ ]
125
+ },
126
+ {
127
+ "cell_type": "markdown",
128
+ "id": "283ca08c",
129
+ "metadata": {
130
+ "slideshow": {
131
+ "slide_type": "subslide"
132
+ }
133
+ },
134
+ "source": [
135
+ "## ¿Qué son los \"modelos de lenguaje\"? (Language Models)\n",
136
+ "\n",
137
+ "- Modelos de aprendizaje automático.\n",
138
+ "- Dado un contexto (e.g. una lista de palabras previas), predicen la palabra siguiente.\n",
139
+ "- Se entrenan con texto libre."
140
+ ]
141
+ },
142
+ {
143
+ "cell_type": "markdown",
144
+ "id": "778b5e91",
145
+ "metadata": {
146
+ "slideshow": {
147
+ "slide_type": "fragment"
148
+ }
149
+ },
150
+ "source": [
151
+ "### ¿Qué son los \"LLMs\"? (Large Language Models)\n",
152
+ "\n",
153
+ "- Modelos de lenguajes entrenados con una gran cantidad de datos y de parámetros:\n",
154
+ " - Suelen entrenarse con corpus del orden de $10^{10}$ palabras.\n",
155
+ " - Suelen tener de $10^8$ o $10^9$ parámetros en adelante.\n",
156
+ "- El término se asocia generalmente a aquellos modelos basados en la arquitectura neuronal del **Transformer**."
157
+ ]
158
+ },
159
+ {
160
+ "cell_type": "markdown",
161
+ "id": "cfc710ea",
162
+ "metadata": {
163
+ "slideshow": {
164
+ "slide_type": "subslide"
165
+ }
166
+ },
167
+ "source": [
168
+ "## ¿Qué es un \"Transformer\"?\n",
169
+ "\n",
170
+ "- Es una arquitectura de red neuronal que se presentó en el paper [\"Attention is All You Need\"](https://arxiv.org/abs/1706.03762).\n",
171
+ "- Existen variantes, de acuerdo a que parte de la arquitectura usan:\n",
172
+ " - Los modelos de traducción de secuencia a secuencia (e.g. el [Transformer](https://arxiv.org/abs/1706.03762) o el [T5](https://arxiv.org/abs/1910.10683)). Tienen codificador y decodificador. Sirven para tareas de transformación (e.g. traducción).\n",
173
+ " - Los modelos basados en el codificador (e.g. [BERT](https://arxiv.org/abs/1810.04805)). Sirven para buscar representaciones vectoriales (embeddings) del texto.\n",
174
+ " - Los modelos basados en el decodificador (e.g. [GPT](https://arxiv.org/abs/2005.14165)). Sirven para generación de texto.\n",
175
+ "- La idea del transformer es \"definir\" una palabra de acuerdo a la relación que tiene con las palabras de su vecindario, en una operación de multiplicación matricial con pesos.\n",
176
+ " - Para una explicación más sencilla pero más detallada sugiero los posts de la serie \"The Illustrated...\" de [Jay Alammar](http://jalammar.github.io/):\n",
177
+ " - [The Illustrated Transformer](http://jalammar.github.io/illustrated-transformer/)\n",
178
+ " - [The Illustrated BERT](http://jalammar.github.io/illustrated-bert/)\n",
179
+ " - [The Illustrated GPT-2](http://jalammar.github.io/illustrated-gpt2/) / [How GPT-3 Works](http://jalammar.github.io/how-gpt3-works-visualizations-animations/)"
180
+ ]
181
+ },
182
+ {
183
+ "cell_type": "markdown",
184
+ "id": "8958cf42",
185
+ "metadata": {
186
+ "slideshow": {
187
+ "slide_type": "slide"
188
+ }
189
+ },
190
+ "source": [
191
+ "# Hugging Face"
192
+ ]
193
+ },
194
+ {
195
+ "cell_type": "markdown",
196
+ "id": "6038bd78",
197
+ "metadata": {
198
+ "slideshow": {
199
+ "slide_type": "subslide"
200
+ }
201
+ },
202
+ "source": [
203
+ "## ¿Qué es Hugging Face?\n",
204
+ "\n",
205
+ "- Una [comunidad colaborativa](https://huggingface.co/) para hacer Inteligencia Artificial (IA).\n",
206
+ "- Cuenta con repositorios para subir [modelos](https://huggingface.co/models), [datasets](https://huggingface.co/datasets) y [demos](https://huggingface.co/spaces).\n",
207
+ "- Además, ofrecen varias librerías orientadas a la IA, particularmente al Aprendizaje Profundo (Deep Learning), entre las que destacan:\n",
208
+ " - [`transformers`](https://huggingface.co/docs/transformers): La que veremos en esta charla, para todo lo relacionado a NLP con LLMs.\n",
209
+ " - [`datasets`](https://huggingface.co/docs/datasets): Una librería especializada en el tratamiento de los conjuntos de datos a utilizar para entrenar/ajustar los LLMs.\n",
210
+ " - [`tokenizers`](https://huggingface.co/docs/tokenizers): Para el proceso de \"tokenización\", i.e. la división de texto de manera discreta en palabras o subpalabras.\n",
211
+ "- Hugging Face no sólo ofrece soluciones sobre NLP, sino que también lo hace con imágenes, con librerías como [`diffusers`](https://huggingface.co/docs/diffusers), para la generación de imágenes:\n",
212
+ " - Lectura recomendada: [The Illustrated Stable Diffusion](http://jalammar.github.io/illustrated-stable-diffusion/)"
213
+ ]
214
+ },
215
+ {
216
+ "cell_type": "markdown",
217
+ "id": "25ad7d45",
218
+ "metadata": {
219
+ "slideshow": {
220
+ "slide_type": "subslide"
221
+ }
222
+ },
223
+ "source": [
224
+ "## ¿Cómo empezar con Hugging Face?\n",
225
+ "\n",
226
+ "- Primero se [crea una cuenta en la página](https://huggingface.co/join).\n",
227
+ "- Luego podemos [crear modelos](https://huggingface.co/new) a través del menú que se despliega de nuestro avatar.\n",
228
+ "- Una vez creado el modelo, este es un repositorio de git que puede accederse clonándolo localmente.\n",
229
+ " - Requiere de [`git-lfs`](https://git-lfs.com/)."
230
+ ]
231
+ },
232
+ {
233
+ "cell_type": "markdown",
234
+ "id": "3c6f89c3",
235
+ "metadata": {
236
+ "slideshow": {
237
+ "slide_type": "slide"
238
+ }
239
+ },
240
+ "source": [
241
+ "# Utilizando un modelo de Hugging Face"
242
+ ]
243
+ },
244
+ {
245
+ "cell_type": "markdown",
246
+ "id": "d06c7318",
247
+ "metadata": {
248
+ "slideshow": {
249
+ "slide_type": "subslide"
250
+ }
251
+ },
252
+ "source": [
253
+ "## Cargando los modelos\n",
254
+ "\n",
255
+ "- Hugging Face ofrece muchísimos modelos en su [repositorio](https://huggingface.co/models), para este caso elegimos el modelo [`bigscience/bloom-3b`](https://huggingface.co/bigscience/bloom-3b) de la organización [Big Science](https://bigscience.huggingface.co/blog/bloom).\n",
256
+ " - Esta organización ha estado [creando modelos](https://huggingface.co/bigscience) bajo una [licencia abierta](https://bigscience.huggingface.co/blog/the-bigscience-rail-license) (con ciertas limitaciones de uso para evitar abuso).\n",
257
+ " - Son responsables del [LLM abierto más grande actualmente disponible](https://huggingface.co/bigscience/bloom).\n",
258
+ "- El modelo elegido es un modelo de 3 mil millones (3 billion) de parámetros."
259
+ ]
260
+ },
261
+ {
262
+ "cell_type": "code",
263
+ "execution_count": 1,
264
+ "id": "0e0d53be",
265
+ "metadata": {
266
+ "slideshow": {
267
+ "slide_type": "fragment"
268
+ }
269
+ },
270
+ "outputs": [],
271
+ "source": [
272
+ "import torch\n",
273
+ "\n",
274
+ "from IPython.display import display, HTML\n",
275
+ "from transformers import AutoModelForCausalLM, AutoTokenizer\n",
276
+ "\n",
277
+ "BASE_MODEL = 'bigscience/bloom-3b' # More models at https://huggingface.co/models\n",
278
+ "\n",
279
+ "tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)\n",
280
+ "model = AutoModelForCausalLM.from_pretrained(\n",
281
+ " BASE_MODEL,\n",
282
+ " low_cpu_mem_usage=True,\n",
283
+ " torch_dtype='auto'\n",
284
+ ")"
285
+ ]
286
+ },
287
+ {
288
+ "cell_type": "markdown",
289
+ "id": "022de9b5",
290
+ "metadata": {
291
+ "slideshow": {
292
+ "slide_type": "subslide"
293
+ }
294
+ },
295
+ "source": [
296
+ "## Generando Texto a Partir de un PROMPT\n",
297
+ "\n",
298
+ "- Los modelos de lenguaje necesitan una semilla, denominada comúnmente **prompt**, para iniciar su conversación.\n",
299
+ "- A partir de dicha semilla, los modelos pueden empezar a predecir las palabras siguiente.\n",
300
+ "- La coherencia de la frase depende de varios aspectos:\n",
301
+ " - El tamaño y [entrenamiento](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb) o [ajuste](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling.ipynb) (fine-tuning) del modelo.\n",
302
+ " - Modelos más grandes suelen ser mejor en escenarios \"open end\", aunque pueden desvariar (o \"alucinar\").\n",
303
+ " - El tipo de datos con el que se entrenó/ajustó el modelo.\n",
304
+ " - La [estrategia](https://github.com/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb) a la hora de generar texto.\n",
305
+ " - La [documentación de Hugging Face](https://huggingface.co/docs/transformers/notebooks) tiene más ejemplos que pueden reproducirse."
306
+ ]
307
+ },
308
+ {
309
+ "cell_type": "markdown",
310
+ "id": "e89d104b",
311
+ "metadata": {
312
+ "slideshow": {
313
+ "slide_type": "subslide"
314
+ }
315
+ },
316
+ "source": [
317
+ "### Estableciendo un PROMPT\n",
318
+ "\n",
319
+ "- El **prompt** inicial es el que \"ayudará\" al modelo a devolver resultados más o menos coherentes.\n",
320
+ "- Actualmente es más un arte que una ciencia.\n",
321
+ " - **No existe el \"prompt engineering\" porque los modelos no son determinísticos.**\n",
322
+ "- Depende muchísimo del modelo, la inicialización aleatoria (i.e. la suerte), la tarea que se busca resolver, entre otros factores.\n",
323
+ "- Algo bastante común es que se le den ejemplos concretos de cómo se espera que genere texto.\n",
324
+ " - A esta práctica se le conoce como [\"Few Shot Learning\"](https://arxiv.org/abs/2005.14165), si bien el modelo no \"aprende\" sino que busca contextos similares a los vistos en los ejemplos."
325
+ ]
326
+ },
327
+ {
328
+ "cell_type": "markdown",
329
+ "id": "6e6b4464",
330
+ "metadata": {
331
+ "slideshow": {
332
+ "slide_type": "subslide"
333
+ }
334
+ },
335
+ "source": [
336
+ "### Ejemplo de PROMPT\n",
337
+ "\n",
338
+ "- Siguiendo los ejemplos de [esta publicación](https://medium.com/@fractal.ai/create-conversational-agents-using-bloom-part-1-63a66e6321c0), y en vistas de armar un chatbot, buscaré definir 4 cosas:\n",
339
+ " - La \"identidad\", i.e. ¿Qué es?\n",
340
+ " - La \"intención\", i.e. ¿Qué hace?\n",
341
+ " - El \"comportamiento\", i.e. ¿Cómo lo hace?\n",
342
+ " - Además le daré pie a que continué una conversación (\"Few Shot Learning\")."
343
+ ]
344
+ },
345
+ {
346
+ "cell_type": "code",
347
+ "execution_count": 2,
348
+ "id": "c1227c49",
349
+ "metadata": {
350
+ "slideshow": {
351
+ "slide_type": "fragment"
352
+ }
353
+ },
354
+ "outputs": [],
355
+ "source": [
356
+ "PROMPT = \"\"\"\n",
357
+ "La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.\n",
358
+ "El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.\n",
359
+ "El EXPERTO es conversacional, optimista, flexible, creativo y genera respuestas parecidas a un humano.\n",
360
+ "\n",
361
+ "HUMANO: Hola, ¿Cómo estás?\n",
362
+ "EXPERTO: Hola, muy bien. Estoy acá para ayudarte con preguntas respecto al software libre.\n",
363
+ "\n",
364
+ "HUMANO: ¿Qué es el software libre?\n",
365
+ "EXPERTO:\"\"\".strip()"
366
+ ]
367
+ },
368
+ {
369
+ "cell_type": "markdown",
370
+ "id": "82988db2",
371
+ "metadata": {
372
+ "slideshow": {
373
+ "slide_type": "subslide"
374
+ }
375
+ },
376
+ "source": [
377
+ "### Generando texto de manera \"Greedy\"\n",
378
+ "\n",
379
+ "- La estrategia para generar texto puede variar. La opción más directa es **greedy**, i.e. devolver la palabra que es más probable después de la secuencia.\n",
380
+ " - La principal ventaja de esta alternativa, es que es determinística, i.e. ante la misma entrada debería devolver la misma salida.\n",
381
+ " - La principal desventaja es que tiende a repetir y quedar limitada a ciertas frases o palabras."
382
+ ]
383
+ },
384
+ {
385
+ "cell_type": "code",
386
+ "execution_count": 3,
387
+ "id": "11bec6de",
388
+ "metadata": {
389
+ "slideshow": {
390
+ "slide_type": "fragment"
391
+ }
392
+ },
393
+ "outputs": [
394
+ {
395
+ "name": "stdout",
396
+ "output_type": "stream",
397
+ "text": [
398
+ "La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.\n",
399
+ "El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.\n",
400
+ "El EXPERTO es conversacional, optimista, flexible, creativo y genera respuestas parecidas a un humano.\n",
401
+ "\n",
402
+ "HUMANO: Hola, ¿Cómo estás?\n",
403
+ "EXPERTO: Hola, pmuy bien. Estoy acá para ayudarte con preguntas respecto al software libre.\n",
404
+ "\n",
405
+ "HUMANO: ¿Qué es el software libre?\n",
406
+ "EXPERTO: El software libre es un software que se puede modificar, redistribuir y distribuir libremente.\n",
407
+ "HUMANO: ¿En qué consiste la licencia GPL?\n",
408
+ "EXPERTO: La licencia GPL es una licencia de software libre que permite a los usuarios modificar, redistribuir\n"
409
+ ]
410
+ }
411
+ ],
412
+ "source": [
413
+ "MAX_TOKENS = 50\n",
414
+ "input_ids = tokenizer.encode(PROMPT, return_tensors='pt')\n",
415
+ "greedy_output = model.generate(input_ids, max_length=input_ids.shape[1] + MAX_TOKENS)\n",
416
+ "output = tokenizer.decode(greedy_output[0], skip_special_tokens=True)\n",
417
+ "\n",
418
+ "print(output)"
419
+ ]
420
+ },
421
+ {
422
+ "cell_type": "markdown",
423
+ "id": "ba05a269",
424
+ "metadata": {
425
+ "slideshow": {
426
+ "slide_type": "subslide"
427
+ }
428
+ },
429
+ "source": [
430
+ "### Generando texto usando aleatoriedad\n",
431
+ "\n",
432
+ "- Si bien hay [varias estrategias para generar texto libre](https://github.com/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb) una que resulta muy interesante es mediante el sampleo estadístico.\n",
433
+ "- La idea es que la manera de seleccionar la siguiente palabra es con cierta probabilidad estadística (i.e. no siempre la más probable).\n",
434
+ " - La principal ventaja es que hace el texto más \"creativo\" y más \"humano\".\n",
435
+ " - La principal desventaja es que no es determinístico y es suceptible de \"alucinar\".\n",
436
+ " - En este caso se samplea de las `top_k` palabras más probable que a su vez son la menor cantidad de palabras cuya probabilidad conjunta es mayor que `top_p`."
437
+ ]
438
+ },
439
+ {
440
+ "cell_type": "code",
441
+ "execution_count": 4,
442
+ "id": "dc66f288",
443
+ "metadata": {
444
+ "slideshow": {
445
+ "slide_type": "fragment"
446
+ }
447
+ },
448
+ "outputs": [
449
+ {
450
+ "name": "stdout",
451
+ "output_type": "stream",
452
+ "text": [
453
+ "La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.\n",
454
+ "El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.\n",
455
+ "El EXPERTO es conversacional, optimista, flexible, creativo y genera respuestas parecidas a un humano.\n",
456
+ "\n",
457
+ "HUMANO: Hola, ¿Cómo estás?\n",
458
+ "EXPERTO: Hola, pmuy bien. Estoy acá para ayudarte con preguntas respecto al software libre.\n",
459
+ "\n",
460
+ "HUMANO: ¿Qué es el software libre?\n",
461
+ "EXPERTO: El software libre, es aquel software que esta escrito en un lenguaje de programación que puede ser modificado y copiado por cualquier persona o entidad.\n",
462
+ "\n",
463
+ "HUMANO: ¿En general cuáles son los usos que se pueden dar a un software libre?\n",
464
+ "EXPERTO\n"
465
+ ]
466
+ }
467
+ ],
468
+ "source": [
469
+ "torch.manual_seed(42) # To ensure determinism\n",
470
+ "\n",
471
+ "sampling_output = model.generate(\n",
472
+ " input_ids,\n",
473
+ " do_sample=True,\n",
474
+ " max_length=input_ids.shape[1] + MAX_TOKENS,\n",
475
+ " top_k=50,\n",
476
+ " top_p=0.95,\n",
477
+ ")\n",
478
+ "output = tokenizer.decode(sampling_output[0], skip_special_tokens=True)\n",
479
+ "\n",
480
+ "print(output)"
481
+ ]
482
+ },
483
+ {
484
+ "cell_type": "markdown",
485
+ "id": "98bdd38e",
486
+ "metadata": {
487
+ "slideshow": {
488
+ "slide_type": "subslide"
489
+ }
490
+ },
491
+ "source": [
492
+ "### Un Chatbot Sencillo\n",
493
+ "\n",
494
+ "- El modelo de lenguaje no tiene noción de cuando parar, porque está entrenado para continuar el mensaje dado en el **prompt**.\n",
495
+ " - Seguirá generando texto hasta alcanzar el valor del parámetro `max_length`.\n",
496
+ " - El texto generado inluirá las palabras que marcan la conversación (i.e. \"HUMANO\" y \"EXPERTO\").\n",
497
+ "- Para poder utilizar un modelo para hacer un **chatbot** requerimos de un poco de ingeniería de software clásica.\n",
498
+ " - Una opción es utilizar precisamente las palabras que definen la conversación como puntos de inicio y final, y descartar el resto.\n",
499
+ "- En [`chatbot.py`](./chatbot.py) hay un ejemplo sencillo de cómo puede realizarse esto.\n",
500
+ " - Consiste de una clase `ChatBot` que sirve como *wrapper* de los modelos de Hugging Face.\n",
501
+ " - Posee un CLI sencillo que mantiene un loop continuo para chatear."
502
+ ]
503
+ },
504
+ {
505
+ "cell_type": "code",
506
+ "execution_count": null,
507
+ "id": "a3e12232",
508
+ "metadata": {
509
+ "slideshow": {
510
+ "slide_type": "subslide"
511
+ }
512
+ },
513
+ "outputs": [],
514
+ "source": [
515
+ "import torch\n",
516
+ "from chatbot import ChatBot # local module in the repository\n",
517
+ "\n",
518
+ "torch.manual_seed(42) # to be more deterministic\n",
519
+ "\n",
520
+ "PROMPT = \"\"\"\n",
521
+ "La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.\n",
522
+ "El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.\n",
523
+ "El EXPERTO es conversacional, optimista, flexible, creativo y genera respuestas parecidas a un humano.\n",
524
+ "\n",
525
+ "HUMANO: Hola, ¿Cómo estás?\n",
526
+ "EXPERTO: Hola, muy bien. Estoy acá para ayudarte con preguntas respecto al software libre.\n",
527
+ "\"\"\".strip()\n",
528
+ "\n",
529
+ "chatbot = ChatBot(\n",
530
+ " base_model='bigscience/bloom-3b',\n",
531
+ " initial_prompt=PROMPT,\n",
532
+ " keep_context=True,\n",
533
+ " creative=True,\n",
534
+ " human_identifier='HUMANO',\n",
535
+ " bot_identifier='EXPERTO'\n",
536
+ ")\n",
537
+ "\n",
538
+ "while True:\n",
539
+ " input_text = input('> ')\n",
540
+ " if input_text == 'exit':\n",
541
+ " break\n",
542
+ " print(chatbot.chat(input_text))"
543
+ ]
544
+ },
545
+ {
546
+ "cell_type": "markdown",
547
+ "id": "6e570fc3",
548
+ "metadata": {
549
+ "slideshow": {
550
+ "slide_type": "slide"
551
+ }
552
+ },
553
+ "source": [
554
+ "# Personalizando un modelo de Hugging Face"
555
+ ]
556
+ },
557
+ {
558
+ "cell_type": "markdown",
559
+ "id": "adb09645",
560
+ "metadata": {
561
+ "slideshow": {
562
+ "slide_type": "subslide"
563
+ }
564
+ },
565
+ "source": [
566
+ "## ¿Cómo se entrenan los LLMs?\n",
567
+ "\n",
568
+ "- Para entrenar LLMs se requiere de muchos datos y mucho cómputo.\n",
569
+ "- El modelo de GPT-3 se estima que tuvo un costo de entrenamiento cercano a los U$D4.6 Millones\n",
570
+ " - Requirió de varias semanas de entrenamiento\n",
571
+ " - El corpus reportado es de aproximadamente 500 mil millones (billions) de palabras.\n",
572
+ " - Varios GPUS para entrenarlo y hardware especializado\n",
573
+ " - No son modelos que entren en la memoria de una sola GPU."
574
+ ]
575
+ },
576
+ {
577
+ "cell_type": "markdown",
578
+ "id": "16a26206",
579
+ "metadata": {
580
+ "slideshow": {
581
+ "slide_type": "fragment"
582
+ }
583
+ },
584
+ "source": [
585
+ "### ¿Y entonces qué puedo hacer?\n",
586
+ "\n",
587
+ "- Una ventaja de los LLMs es que el entrenamiento es sobre texto libre, pero se puede **especializar**.\n",
588
+ "- Uno puede entrenar modelos para diversas tareas especializados en corpus más chico.\n",
589
+ "- El hecho de que no sea \"desde cero\" ayuda a evitar sobreajuste (overfit) y tiene buen desempeño.\n",
590
+ "- El procedimiento de **especialización** se conoce como **fine-tuning**."
591
+ ]
592
+ },
593
+ {
594
+ "cell_type": "markdown",
595
+ "id": "649e2ef4",
596
+ "metadata": {
597
+ "slideshow": {
598
+ "slide_type": "subslide"
599
+ }
600
+ },
601
+ "source": [
602
+ "## ¿Cómo personalizar un modelo de Hugging Face?\n",
603
+ "\n",
604
+ "- Se inicia por algún modelo pre-entrenado para la tarea específica que uno busca (e.g. clasificación, generación, etc).\n",
605
+ "- Se toma un corpus especializado (anotado, revisado, etc.) y se entrena utilizando dicho corpus.\n",
606
+ "- Intentaremos [entrenar que un modelo genere texto](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling.ipynb) con el estilo del **Martín Fierro**.\n",
607
+ "- Para hacerlo menos pesado, utilizaremos un modelo más chico `DeepESP/gpt2-spanish` como base.\n"
608
+ ]
609
+ },
610
+ {
611
+ "cell_type": "code",
612
+ "execution_count": 1,
613
+ "id": "17f2884d",
614
+ "metadata": {
615
+ "slideshow": {
616
+ "slide_type": "fragment"
617
+ }
618
+ },
619
+ "outputs": [],
620
+ "source": [
621
+ "import torch\n",
622
+ "from transformers import AutoModelForCausalLM, AutoTokenizer\n",
623
+ "\n",
624
+ "BASE_MODEL = 'DeepESP/gpt2-spanish' # We play with a smaller model\n",
625
+ "tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)\n",
626
+ "model = AutoModelForCausalLM.from_pretrained(BASE_MODEL)"
627
+ ]
628
+ },
629
+ {
630
+ "cell_type": "markdown",
631
+ "id": "16690597",
632
+ "metadata": {
633
+ "slideshow": {
634
+ "slide_type": "subslide"
635
+ }
636
+ },
637
+ "source": [
638
+ "### Probando el Modelo Base\n",
639
+ "\n",
640
+ "- Antes de ajustar el modelo vemos cómo se desenvuelve si le damos como entrada el primer verso del \"Martín Fierro\"."
641
+ ]
642
+ },
643
+ {
644
+ "cell_type": "code",
645
+ "execution_count": 2,
646
+ "id": "322a4a9b",
647
+ "metadata": {
648
+ "slideshow": {
649
+ "slide_type": "fragment"
650
+ }
651
+ },
652
+ "outputs": [
653
+ {
654
+ "name": "stdout",
655
+ "output_type": "stream",
656
+ "text": [
657
+ "Aquí me pongo a cantar y a llorar. \n",
658
+ "\n",
659
+ "Los sollozos de Meggie se desvanecen por la noche en el salón. Al parecer no se ve nada. \n",
660
+ "\n",
661
+ "—¿Y si no fuera el final del mundo, el fin de un mundo?\n"
662
+ ]
663
+ }
664
+ ],
665
+ "source": [
666
+ "torch.manual_seed(42) # To ensure determinism\n",
667
+ "\n",
668
+ "input_ids = tokenizer.encode(\"Aquí me pongo a cantar\", return_tensors='pt')\n",
669
+ "sampling_output = model.generate(input_ids, do_sample=True, max_length=50, top_k=50, top_p=0.95)\n",
670
+ "output = tokenizer.decode(sampling_output[0], skip_special_tokens=True)\n",
671
+ "\n",
672
+ "print(output)"
673
+ ]
674
+ },
675
+ {
676
+ "cell_type": "markdown",
677
+ "id": "ec722e81",
678
+ "metadata": {
679
+ "slideshow": {
680
+ "slide_type": "subslide"
681
+ }
682
+ },
683
+ "source": [
684
+ "### Cargando el Dataset\n",
685
+ "\n",
686
+ "- Utilizamos la librería [datasets](https://huggingface.co/docs/datasets/index) de Hugging Face para cargar el corpus.\n",
687
+ "- En el directorio [`./data`] tenemos dos archivos: [`martin-fierro_train.txt`](./data/martin-fierro_train.txt) y [`martin-fierro_validation.txt`](./data/martin-fierro_validation.txt).\n",
688
+ " - El archivo de entrenamiento es sobre las 12 primeras partes.\n",
689
+ " - El archivo de validación es sobre la última parte."
690
+ ]
691
+ },
692
+ {
693
+ "cell_type": "code",
694
+ "execution_count": 3,
695
+ "id": "5a27197e",
696
+ "metadata": {
697
+ "slideshow": {
698
+ "slide_type": "fragment"
699
+ }
700
+ },
701
+ "outputs": [
702
+ {
703
+ "name": "stdout",
704
+ "output_type": "stream",
705
+ "text": [
706
+ "I - Cantor y Gaucho.\n",
707
+ "\n",
708
+ "1\n",
709
+ "Aquí me pongo a cantar\n",
710
+ "Al compás de la vigüela,\n",
711
+ "Que el hombre que lo desvela\n",
712
+ "Una pena estraordinaria\n",
713
+ "Como la ave solitaria\n",
714
+ "Con el cantar se consuela.\n"
715
+ ]
716
+ }
717
+ ],
718
+ "source": [
719
+ "from datasets import load_dataset\n",
720
+ "\n",
721
+ "datasets = load_dataset('text', data_files={'train': './data/martin-fierro_train.txt',\n",
722
+ " 'validation': './data/martin-fierro_validation.txt'})\n",
723
+ "print('\\n'.join(datasets['train'][:9]['text']))"
724
+ ]
725
+ },
726
+ {
727
+ "cell_type": "markdown",
728
+ "id": "9504707f",
729
+ "metadata": {
730
+ "slideshow": {
731
+ "slide_type": "subslide"
732
+ }
733
+ },
734
+ "source": [
735
+ "### Tokenizando los datos\n",
736
+ "\n",
737
+ "- La función auxiliar `tokenize` del módulo [`utils`](./utils.py) sirve para tokenizar y codificar el conjunto de datos de manera eficiente mediante el [método `map`](https://huggingface.co/docs/datasets/about_map_batch).\n",
738
+ "- Lo que devuelve es un nuevo dataset cuyos tokens están convertidos en índices del vocabulario y [máscaras de atención](https://huggingface.co/docs/transformers/glossary#attention-mask)"
739
+ ]
740
+ },
741
+ {
742
+ "cell_type": "code",
743
+ "execution_count": 4,
744
+ "id": "33059c5f",
745
+ "metadata": {
746
+ "scrolled": true,
747
+ "slideshow": {
748
+ "slide_type": "fragment"
749
+ }
750
+ },
751
+ "outputs": [],
752
+ "source": [
753
+ "from utils import tokenize # local module in the repository\n",
754
+ "\n",
755
+ "tokenized_datasets = datasets.map(tokenize(tokenizer), batched=True, num_proc=4, remove_columns=['text'])"
756
+ ]
757
+ },
758
+ {
759
+ "cell_type": "markdown",
760
+ "id": "81d67b22",
761
+ "metadata": {
762
+ "slideshow": {
763
+ "slide_type": "subslide"
764
+ }
765
+ },
766
+ "source": [
767
+ "### Agrupando los textos\n",
768
+ "\n",
769
+ "- Para entrenar de manera más eficiente es común utilizar lo que se conoce como **mini-batch gradient descent**.\n",
770
+ "- La idea es tomar los textos de a bloques de un valor máximo.\n",
771
+ " - El valor máximo estará limitado por la memoria de la unidad de procesamiento (e.g. GPU).\n",
772
+ "- Utilizamos la función auxiliar `group_texts` del módulo [`utils`](./utils.py).\n",
773
+ " - La función además establece las etiquetas que utilizará Hugging Face para entrenar.\n",
774
+ " - En este caso las etiquetas son las mismas palabras, porque busca predecir la palabra siguiente."
775
+ ]
776
+ },
777
+ {
778
+ "cell_type": "code",
779
+ "execution_count": 5,
780
+ "id": "3100e195",
781
+ "metadata": {
782
+ "scrolled": true,
783
+ "slideshow": {
784
+ "slide_type": "fragment"
785
+ }
786
+ },
787
+ "outputs": [],
788
+ "source": [
789
+ "from functools import partial\n",
790
+ "from utils import group_texts # local module in the repository\n",
791
+ "\n",
792
+ "lm_datasets = tokenized_datasets.map(\n",
793
+ " partial(group_texts, block_size=128),\n",
794
+ " batched=True,\n",
795
+ " batch_size=1024,\n",
796
+ " num_proc=4,\n",
797
+ ")"
798
+ ]
799
+ },
800
+ {
801
+ "cell_type": "markdown",
802
+ "id": "d64a23ec",
803
+ "metadata": {
804
+ "slideshow": {
805
+ "slide_type": "subslide"
806
+ }
807
+ },
808
+ "source": [
809
+ "### Decodificando\n",
810
+ "\n",
811
+ "- Podemos ver que los textos pasan a estar agrupados en bloques de 128 tokens.\n",
812
+ "- Además, vemos que el texto fue reemplazado por números (índices en el vocabulario).\n",
813
+ "- Por último, si decodificamos estos números, obtenemos el texto original."
814
+ ]
815
+ },
816
+ {
817
+ "cell_type": "code",
818
+ "execution_count": 6,
819
+ "id": "b9d33b7b",
820
+ "metadata": {
821
+ "slideshow": {
822
+ "slide_type": "fragment"
823
+ }
824
+ },
825
+ "outputs": [
826
+ {
827
+ "name": "stdout",
828
+ "output_type": "stream",
829
+ "text": [
830
+ "128\n",
831
+ "[50, 1368, 6505, 282, 324, 24275, 526, 23, 208, 208]\n"
832
+ ]
833
+ }
834
+ ],
835
+ "source": [
836
+ "print(len(lm_datasets['train'][0]['input_ids']))\n",
837
+ "print(lm_datasets['train'][0]['input_ids'][:10])"
838
+ ]
839
+ },
840
+ {
841
+ "cell_type": "code",
842
+ "execution_count": 7,
843
+ "id": "7dfb316d",
844
+ "metadata": {
845
+ "scrolled": false,
846
+ "slideshow": {
847
+ "slide_type": "fragment"
848
+ }
849
+ },
850
+ "outputs": [
851
+ {
852
+ "name": "stdout",
853
+ "output_type": "stream",
854
+ "text": [
855
+ "I - Cantor y Gaucho.\n",
856
+ "\n",
857
+ "1\n",
858
+ "Aquí me pongo a cantar\n",
859
+ "Al compás de la vigüela,\n",
860
+ "Que el hombre que lo desvela\n",
861
+ "Una pena estraordinaria\n",
862
+ "Como la ave solitaria\n",
863
+ "Con el cantar se consuela.\n",
864
+ "\n",
865
+ "2\n",
866
+ "Pido a los Santos del Cielo\n",
867
+ "Que ayuden mi pensamiento;\n",
868
+ "Les pido en este momento\n",
869
+ "Que voy a cantar mi historia\n",
870
+ "Me refresquen la memoria\n",
871
+ "Y aclaren mi entendimiento.\n",
872
+ "\n",
873
+ "3\n",
874
+ "Vengan Santos milagrosos,\n",
875
+ "Vengan todos en mi ayuda,\n",
876
+ "Que la lengua se me añuda\n",
877
+ "Y se me turba\n"
878
+ ]
879
+ }
880
+ ],
881
+ "source": [
882
+ "print(tokenizer.decode(lm_datasets['train'][0]['input_ids']))"
883
+ ]
884
+ },
885
+ {
886
+ "cell_type": "markdown",
887
+ "id": "d7e2032f",
888
+ "metadata": {
889
+ "slideshow": {
890
+ "slide_type": "subslide"
891
+ }
892
+ },
893
+ "source": [
894
+ "### Compartir Modelo en Hugging Face\n",
895
+ "\n",
896
+ "- Una opción a la hora de entrenar un modelo es subirlo a Hugging Face para compartirlo con la comunidad.\n",
897
+ "- Para eso, una vez que tengan la cuenta de Hugging Face, y creado el modelo, hay que hacer login mediante un [token](https://huggingface.co/settings/tokens)."
898
+ ]
899
+ },
900
+ {
901
+ "cell_type": "code",
902
+ "execution_count": 8,
903
+ "id": "a8b90ba2",
904
+ "metadata": {
905
+ "scrolled": true,
906
+ "slideshow": {
907
+ "slide_type": "fragment"
908
+ }
909
+ },
910
+ "outputs": [],
911
+ "source": [
912
+ "from huggingface_hub import notebook_login\n",
913
+ "\n",
914
+ "notebook_login()"
915
+ ]
916
+ },
917
+ {
918
+ "cell_type": "markdown",
919
+ "id": "a6b775d3",
920
+ "metadata": {
921
+ "slideshow": {
922
+ "slide_type": "subslide"
923
+ }
924
+ },
925
+ "source": [
926
+ "### Entrenamiento\n",
927
+ "\n",
928
+ "- Una vez definido el conjunto de datos, pasamos a la parte más intensa computacionalmente, el entrenamiento.\n",
929
+ "- Podemos decidir guardar el modelo localmente o hacer un backup de cada época del modelo en Hugging Face.\n",
930
+ "- Definimos las propiedades del entrenamiento mediante [`TrainingArguments`](https://huggingface.co/docs/transformers/v4.28.1/en/main_classes/trainer#transformers.TrainingArguments).\n",
931
+ "- Definimos el entrenamiento del modelo mediante [`Trainer`](https://huggingface.co/docs/transformers/v4.28.1/en/main_classes/trainer#transformers.Trainer).\n",
932
+ " - El entrenamiento tardará desde unos segundos hasta varios minutos dependiendo el poder de cómputo."
933
+ ]
934
+ },
935
+ {
936
+ "cell_type": "code",
937
+ "execution_count": 9,
938
+ "id": "3b121d21",
939
+ "metadata": {
940
+ "slideshow": {
941
+ "slide_type": "subslide"
942
+ }
943
+ },
944
+ "outputs": [
945
+ {
946
+ "data": {
947
+ "text/html": [
948
+ "\n",
949
+ " <div>\n",
950
+ " \n",
951
+ " <progress value='180' max='180' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
952
+ " [180/180 11:44, Epoch 10/10]\n",
953
+ " </div>\n",
954
+ " <table border=\"1\" class=\"dataframe\">\n",
955
+ " <thead>\n",
956
+ " <tr style=\"text-align: left;\">\n",
957
+ " <th>Epoch</th>\n",
958
+ " <th>Training Loss</th>\n",
959
+ " <th>Validation Loss</th>\n",
960
+ " </tr>\n",
961
+ " </thead>\n",
962
+ " <tbody>\n",
963
+ " <tr>\n",
964
+ " <td>1</td>\n",
965
+ " <td>4.386400</td>\n",
966
+ " <td>4.202457</td>\n",
967
+ " </tr>\n",
968
+ " <tr>\n",
969
+ " <td>2</td>\n",
970
+ " <td>3.948000</td>\n",
971
+ " <td>4.043974</td>\n",
972
+ " </tr>\n",
973
+ " <tr>\n",
974
+ " <td>3</td>\n",
975
+ " <td>3.796200</td>\n",
976
+ " <td>3.980350</td>\n",
977
+ " </tr>\n",
978
+ " <tr>\n",
979
+ " <td>4</td>\n",
980
+ " <td>3.610500</td>\n",
981
+ " <td>3.945783</td>\n",
982
+ " </tr>\n",
983
+ " <tr>\n",
984
+ " <td>5</td>\n",
985
+ " <td>3.444400</td>\n",
986
+ " <td>3.927984</td>\n",
987
+ " </tr>\n",
988
+ " <tr>\n",
989
+ " <td>6</td>\n",
990
+ " <td>3.385500</td>\n",
991
+ " <td>3.919229</td>\n",
992
+ " </tr>\n",
993
+ " <tr>\n",
994
+ " <td>7</td>\n",
995
+ " <td>3.314200</td>\n",
996
+ " <td>3.909090</td>\n",
997
+ " </tr>\n",
998
+ " <tr>\n",
999
+ " <td>8</td>\n",
1000
+ " <td>3.219200</td>\n",
1001
+ " <td>3.907399</td>\n",
1002
+ " </tr>\n",
1003
+ " <tr>\n",
1004
+ " <td>9</td>\n",
1005
+ " <td>3.161500</td>\n",
1006
+ " <td>3.906959</td>\n",
1007
+ " </tr>\n",
1008
+ " <tr>\n",
1009
+ " <td>10</td>\n",
1010
+ " <td>3.163700</td>\n",
1011
+ " <td>3.906726</td>\n",
1012
+ " </tr>\n",
1013
+ " </tbody>\n",
1014
+ "</table><p>"
1015
+ ],
1016
+ "text/plain": [
1017
+ "<IPython.core.display.HTML object>"
1018
+ ]
1019
+ },
1020
+ "metadata": {},
1021
+ "output_type": "display_data"
1022
+ }
1023
+ ],
1024
+ "source": [
1025
+ "from transformers import Trainer, TrainingArguments\n",
1026
+ "\n",
1027
+ "training_args = TrainingArguments(\n",
1028
+ " 'flisol-cba-martin-fierro',\n",
1029
+ " evaluation_strategy='epoch',\n",
1030
+ " num_train_epochs=10,\n",
1031
+ " learning_rate=2e-5,\n",
1032
+ " weight_decay=0.01,\n",
1033
+ " logging_steps=5\n",
1034
+ ")\n",
1035
+ "\n",
1036
+ "trainer = Trainer(\n",
1037
+ " model=model,\n",
1038
+ " args=training_args,\n",
1039
+ " train_dataset=lm_datasets['train'],\n",
1040
+ " eval_dataset=lm_datasets['validation']\n",
1041
+ ")\n",
1042
+ "\n",
1043
+ "trainer.train()\n",
1044
+ "trainer.push_to_hub() # This pushes the trained model to Hugging Face model repository\n",
1045
+ "tokenizer.push_to_hub('flisol-cba-martin-fierro')"
1046
+ ]
1047
+ },
1048
+ {
1049
+ "cell_type": "markdown",
1050
+ "id": "db2099f4",
1051
+ "metadata": {
1052
+ "slideshow": {
1053
+ "slide_type": "subslide"
1054
+ }
1055
+ },
1056
+ "source": [
1057
+ "### Probando el Nuevo Modelo\n",
1058
+ "\n",
1059
+ "- Ahora que tenemos el modelo entrenado, la pregunta es, ¿Cómo se comportará?\n",
1060
+ "- Para ello volvemos a hacer la prueba anterior, quizás esta vez con mejores resultados.\n",
1061
+ " - Para evitar tener que entrenar el modelo nuevamente directamente tomo el [modelo compartido en Hugging Face](https://huggingface.co/crscardellino/flisol-cba-martin-fierro)."
1062
+ ]
1063
+ },
1064
+ {
1065
+ "cell_type": "code",
1066
+ "execution_count": 1,
1067
+ "id": "6a35e80f",
1068
+ "metadata": {
1069
+ "slideshow": {
1070
+ "slide_type": "fragment"
1071
+ }
1072
+ },
1073
+ "outputs": [
1074
+ {
1075
+ "name": "stdout",
1076
+ "output_type": "stream",
1077
+ "text": [
1078
+ "Aquí me pongo a cantar;\n",
1079
+ "y si tengo el sueño:\n",
1080
+ "de pronto se me ha quedado la sangre:\n",
1081
+ "como te asombre se me\n",
1082
+ "lo oí decir muchas veces,\n",
1083
+ "pero el tiempo me ha borrado.\n",
1084
+ "\n",
1085
+ "2\n",
1086
+ "Soy\n"
1087
+ ]
1088
+ }
1089
+ ],
1090
+ "source": [
1091
+ "import torch\n",
1092
+ "from transformers import AutoModelForCausalLM, AutoTokenizer\n",
1093
+ "\n",
1094
+ "MODEL = 'flisol-cba-martin-fierro'\n",
1095
+ "tokenizer = AutoTokenizer.from_pretrained(MODEL)\n",
1096
+ "model = AutoModelForCausalLM.from_pretrained(MODEL)\n",
1097
+ "\n",
1098
+ "torch.manual_seed(42) # To ensure determinism\n",
1099
+ "\n",
1100
+ "input_ids = tokenizer.encode(\"Aquí me pongo a cantar\", return_tensors='pt')\n",
1101
+ "sampling_output = model.generate(input_ids, do_sample=True, max_length=50, top_k=50, top_p=0.95)\n",
1102
+ "output = tokenizer.decode(sampling_output[0], skip_special_tokens=True)\n",
1103
+ "\n",
1104
+ "print(output)"
1105
+ ]
1106
+ },
1107
+ {
1108
+ "cell_type": "markdown",
1109
+ "id": "f4e33157",
1110
+ "metadata": {
1111
+ "slideshow": {
1112
+ "slide_type": "slide"
1113
+ }
1114
+ },
1115
+ "source": [
1116
+ "# ¡Muchas Gracias!"
1117
+ ]
1118
+ },
1119
+ {
1120
+ "cell_type": "markdown",
1121
+ "id": "f04a4e4a",
1122
+ "metadata": {
1123
+ "slideshow": {
1124
+ "slide_type": "subslide"
1125
+ }
1126
+ },
1127
+ "source": [
1128
+ "## ¿Preguntas?\n",
1129
+ "\n",
1130
+ "* Twitter: https://twitter.com/crscardellino\n",
1131
+ "* Mastodon: https://mastodon.social/@crscardellino\n",
1132
+ "* LinkedIn: https://www.linkedin.com/in/crscardellino\n",
1133
+ "* Página Personal: https://crscardellino.ar / https://crscardellino.github.io\n",
1134
+ "* GitHub: https://github.com/crscardellino/\n",
1135
+ "* Código y modelo de la presentación: https://huggingface.co/crscardellino/flisol-cba-martin-fierro/"
1136
+ ]
1137
+ }
1138
+ ],
1139
+ "metadata": {
1140
+ "celltoolbar": "Slideshow",
1141
+ "kernelspec": {
1142
+ "display_name": "Python 3 (ipykernel)",
1143
+ "language": "python",
1144
+ "name": "python3"
1145
+ },
1146
+ "language_info": {
1147
+ "codemirror_mode": {
1148
+ "name": "ipython",
1149
+ "version": 3
1150
+ },
1151
+ "file_extension": ".py",
1152
+ "mimetype": "text/x-python",
1153
+ "name": "python",
1154
+ "nbconvert_exporter": "python",
1155
+ "pygments_lexer": "ipython3",
1156
+ "version": "3.10.8"
1157
+ },
1158
+ "rise": {
1159
+ "scroll": true
1160
+ }
1161
+ },
1162
+ "nbformat": 4,
1163
+ "nbformat_minor": 5
1164
+ }
generation_config.json ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ {
2
+ "_from_model_config": true,
3
+ "bos_token_id": 50256,
4
+ "eos_token_id": 50256,
5
+ "transformers_version": "4.28.1"
6
+ }
img/gandalf.gif ADDED

Git LFS Details

  • SHA256: 08fb13734de67803e0a05ccb0d7815894708d348f98bdbedcf476de9343d7d97
  • Pointer size: 132 Bytes
  • Size of remote file: 6.3 MB
img/me.jpg ADDED

Git LFS Details

  • SHA256: 88cd8b8d54c38b9d11b5790edb392112efce80962f0dda882dcc1484b6d70e7a
  • Pointer size: 131 Bytes
  • Size of remote file: 189 kB
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
prompt.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ La siguiente es una conversación entre un HUMANO y un bot EXPERTO en software libre.
2
+ El EXPERTO le ayuda al HUMANO con preguntas acerca de software libre.
3
+ El EXPERTO es conversacional, optimista, flexible, creativo y genera respuestas parecidas a un humano.
4
+
5
+ HUMANO: Hola, ¿Cómo estás?
6
+ EXPERTO: Hola, muy bien. Estoy acá para ayudarte con preguntas respecto al software libre.
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b1e06b84b625ee566a1e8dcc2c7dd064d63481f644349828709ab7757e9dfce0
3
+ size 510395581
requirements.txt ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ --find-links https://download.pytorch.org/whl/torch_stable.html
2
+ accelerate==0.18.0
3
+ datasets==2.11.0
4
+ jupyter==1.0.0
5
+ numpy==1.24.2
6
+ torch==2.0.0+cpu
7
+ transformers==4.28.1
special_tokens_map.json ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|talk|>",
4
+ "<|ax1|>",
5
+ "<|ax2|>",
6
+ "<|ax3|>",
7
+ "<|ax4|>",
8
+ "<|ax5|>",
9
+ "<|ax6|>",
10
+ "<|ax7|>",
11
+ "<|ax8|>",
12
+ "<|ax9|>"
13
+ ],
14
+ "bos_token": "<|endoftext|>",
15
+ "eos_token": "<|endoftext|>",
16
+ "pad_token": "<|endoftext|>",
17
+ "unk_token": "<|endoftext|>"
18
+ }
tokenizer.json ADDED
The diff for this file is too large to render. See raw diff
 
tokenizer_config.json ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "bos_token": {
5
+ "__type": "AddedToken",
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": true,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "clean_up_tokenization_spaces": true,
13
+ "eos_token": {
14
+ "__type": "AddedToken",
15
+ "content": "<|endoftext|>",
16
+ "lstrip": false,
17
+ "normalized": true,
18
+ "rstrip": false,
19
+ "single_word": false
20
+ },
21
+ "errors": "replace",
22
+ "full_tokenizer_file": null,
23
+ "model_max_length": 1000000000000000019884624838656,
24
+ "pad_token": {
25
+ "__type": "AddedToken",
26
+ "content": "<|endoftext|>",
27
+ "lstrip": false,
28
+ "normalized": true,
29
+ "rstrip": false,
30
+ "single_word": false
31
+ },
32
+ "tokenizer_class": "GPT2Tokenizer",
33
+ "unk_token": {
34
+ "__type": "AddedToken",
35
+ "content": "<|endoftext|>",
36
+ "lstrip": false,
37
+ "normalized": true,
38
+ "rstrip": false,
39
+ "single_word": false
40
+ }
41
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:402f127db0f19abbb4782498dd89f615bb96f958fb37ddfd8087acf6cc097fe4
3
+ size 3579
utils.py ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """
2
+ Various utilities needed for the presentation.
3
+ """
4
+
5
+ from datasets import DatasetDict
6
+ from transformers import PreTrainedTokenizerBase
7
+ from typing import Callable, Dict, List
8
+
9
+
10
+ def tokenize(tokenizer: PreTrainedTokenizerBase,
11
+ end_char: str = '\n') -> Callable[[Dict[str, List[str]]], DatasetDict]:
12
+ """
13
+ Helper function that returns a function to use with the `map` method of
14
+ datasets.DatasetDict. It takes a tokenizer and generates a function that
15
+ applies that tokenizer with an optional `end_char` parameter (e.g. a
16
+ newline) that might be needed (e.g. when trying to tokenize and keep the
17
+ structure of a poem wich needs the newline after each sentence). This is
18
+ needed since the function `datasets.load_dataset` forcibly removes the
19
+ newlines characters.
20
+
21
+ Parameters
22
+ ----------
23
+ tokenizer : PreTrainedTokenizerBase
24
+ The tokenizer to use for the tokenization process.
25
+ end_char : str
26
+ The end character to append to each line.
27
+
28
+ Returns
29
+ -------
30
+ Callable[[Dict[str, List[str]]], DatasetDict]
31
+ The function in charge of the tokenization process.
32
+
33
+ """
34
+ def _tokenize(examples: Dict[str, List[str]]) -> DatasetDict:
35
+ return tokenizer([f'{e}{end_char}' for e in examples['text']])
36
+
37
+ return _tokenize
38
+
39
+
40
+ def group_texts(examples: Dict[str, List[int]],
41
+ block_size: int = 128) -> Dict[str, List[int]]:
42
+ """
43
+ Helper function to concatenate a tokenized dataset (with the function above)
44
+ in chunks of `block_size`. The code was taken from
45
+ https://github.com/huggingface/notebooks/blob/main/examples/language_modeling.ipynb
46
+
47
+ Parameters
48
+ ----------
49
+ examples : Dict[str, List[int]]
50
+ This is actually a `LazyBatch` from the transformers library, that is
51
+ given by the `DatasetDict.map` method. It should be the dataset returned
52
+ after tokenization with the function returned by `tokenize`. It should
53
+ have 2 main keys: 'input_ids' and 'attention_mask'.
54
+ block_size : int
55
+ The size of the block to use in the training process. If the total lenght
56
+ of the group of texts is not divisible by the block size it will ignore the
57
+ remaining data for simplicity.
58
+
59
+ Returns
60
+ -------
61
+ Dict[str, List[str, int]]
62
+ The dictionary that will provide the new dataset divided in chunks of
63
+ `block_size`.
64
+ """
65
+ # Concatenate all texts.
66
+ concatenated_examples = {k: sum(examples[k], []) for k in examples.keys()}
67
+ total_length = len(concatenated_examples['input_ids'])
68
+ # We drop the small remainder, we could add padding if the model supported
69
+ # it instead of this drop, you can customize this part to your needs
70
+ total_length = (total_length // block_size) * block_size
71
+ # Split by chunks of block_size length
72
+ result = {
73
+ k: [t[i:i + block_size] for i in range(0, total_length, block_size)]
74
+ for k, t in concatenated_examples.items()
75
+ }
76
+ # labels to be used by the training phase, it copies since the Transformers
77
+ # library will be in charge of making the shift to the right
78
+ result["labels"] = result["input_ids"].copy()
79
+ return result
vocab.json ADDED
The diff for this file is too large to render. See raw diff