Spaces:
Running
Running
S-MurilloG
commited on
Commit
•
883e900
1
Parent(s):
34f871d
Fine-tuning
Browse files- CARSE_02_FineTuning.ipynb +90 -0
CARSE_02_FineTuning.ipynb
CHANGED
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 3,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"#! pip install openai"
|
10 |
+
]
|
11 |
+
},
|
12 |
+
{
|
13 |
+
"cell_type": "code",
|
14 |
+
"execution_count": 7,
|
15 |
+
"metadata": {},
|
16 |
+
"outputs": [],
|
17 |
+
"source": [
|
18 |
+
"from dotenv import load_dotenv\n",
|
19 |
+
"from openai import OpenAI\n",
|
20 |
+
"import os"
|
21 |
+
]
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"cell_type": "markdown",
|
25 |
+
"metadata": {},
|
26 |
+
"source": [
|
27 |
+
"# Preparación para Fine-Tuning"
|
28 |
+
]
|
29 |
+
},
|
30 |
+
{
|
31 |
+
"cell_type": "code",
|
32 |
+
"execution_count": 14,
|
33 |
+
"metadata": {},
|
34 |
+
"outputs": [],
|
35 |
+
"source": [
|
36 |
+
"load_dotenv()\n",
|
37 |
+
"API_KEY = os.getenv('OPENAI_KEY')"
|
38 |
+
]
|
39 |
+
},
|
40 |
+
{
|
41 |
+
"cell_type": "code",
|
42 |
+
"execution_count": 15,
|
43 |
+
"metadata": {},
|
44 |
+
"outputs": [],
|
45 |
+
"source": [
|
46 |
+
"client = OpenAI()"
|
47 |
+
]
|
48 |
+
},
|
49 |
+
{
|
50 |
+
"cell_type": "markdown",
|
51 |
+
"metadata": {},
|
52 |
+
"source": [
|
53 |
+
"### Subimos nuestro primer file de entrenamiento"
|
54 |
+
]
|
55 |
+
},
|
56 |
+
{
|
57 |
+
"cell_type": "code",
|
58 |
+
"execution_count": null,
|
59 |
+
"metadata": {},
|
60 |
+
"outputs": [],
|
61 |
+
"source": [
|
62 |
+
"#upload_file_1 = client.files.create(\n",
|
63 |
+
" file=open(\"Training_Data/Training_Prompts_1.jsonl\", \"rb\"),\n",
|
64 |
+
" purpose=\"fine-tune\"\n",
|
65 |
+
")"
|
66 |
+
]
|
67 |
+
}
|
68 |
+
],
|
69 |
+
"metadata": {
|
70 |
+
"kernelspec": {
|
71 |
+
"display_name": "base",
|
72 |
+
"language": "python",
|
73 |
+
"name": "python3"
|
74 |
+
},
|
75 |
+
"language_info": {
|
76 |
+
"codemirror_mode": {
|
77 |
+
"name": "ipython",
|
78 |
+
"version": 3
|
79 |
+
},
|
80 |
+
"file_extension": ".py",
|
81 |
+
"mimetype": "text/x-python",
|
82 |
+
"name": "python",
|
83 |
+
"nbconvert_exporter": "python",
|
84 |
+
"pygments_lexer": "ipython3",
|
85 |
+
"version": "3.9.7"
|
86 |
+
}
|
87 |
+
},
|
88 |
+
"nbformat": 4,
|
89 |
+
"nbformat_minor": 2
|
90 |
+
}
|