Spaces:
Build error
Build error
Matthew Hollings
commited on
Commit
•
ddc92b4
1
Parent(s):
6623760
Add a .env
Browse files- .env +1 -0
- fine-tune-llm.ipynb +141 -0
- test.py +2 -0
.env
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
conda activate augmented_poetry
|
fine-tune-llm.ipynb
ADDED
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"from transformers import pipeline"
|
10 |
+
]
|
11 |
+
},
|
12 |
+
{
|
13 |
+
"cell_type": "code",
|
14 |
+
"execution_count": 2,
|
15 |
+
"metadata": {},
|
16 |
+
"outputs": [
|
17 |
+
{
|
18 |
+
"name": "stderr",
|
19 |
+
"output_type": "stream",
|
20 |
+
"text": [
|
21 |
+
"No model was supplied, defaulted to distilbert-base-uncased-finetuned-sst-2-english (https://huggingface.co/distilbert-base-uncased-finetuned-sst-2-english)\n"
|
22 |
+
]
|
23 |
+
},
|
24 |
+
{
|
25 |
+
"data": {
|
26 |
+
"application/vnd.jupyter.widget-view+json": {
|
27 |
+
"model_id": "275d80538ffc43b198489f7044e31309",
|
28 |
+
"version_major": 2,
|
29 |
+
"version_minor": 0
|
30 |
+
},
|
31 |
+
"text/plain": [
|
32 |
+
"Downloading: 0%| | 0.00/629 [00:00<?, ?B/s]"
|
33 |
+
]
|
34 |
+
},
|
35 |
+
"metadata": {},
|
36 |
+
"output_type": "display_data"
|
37 |
+
},
|
38 |
+
{
|
39 |
+
"data": {
|
40 |
+
"application/vnd.jupyter.widget-view+json": {
|
41 |
+
"model_id": "b3158a617e4940109ab018aa2bfd8a94",
|
42 |
+
"version_major": 2,
|
43 |
+
"version_minor": 0
|
44 |
+
},
|
45 |
+
"text/plain": [
|
46 |
+
"Downloading: 0%| | 0.00/256M [00:00<?, ?B/s]"
|
47 |
+
]
|
48 |
+
},
|
49 |
+
"metadata": {},
|
50 |
+
"output_type": "display_data"
|
51 |
+
},
|
52 |
+
{
|
53 |
+
"name": "stderr",
|
54 |
+
"output_type": "stream",
|
55 |
+
"text": [
|
56 |
+
"All model checkpoint layers were used when initializing TFDistilBertForSequenceClassification.\n",
|
57 |
+
"\n",
|
58 |
+
"All the layers of TFDistilBertForSequenceClassification were initialized from the model checkpoint at distilbert-base-uncased-finetuned-sst-2-english.\n",
|
59 |
+
"If your task is similar to the task the model of the checkpoint was trained on, you can already use TFDistilBertForSequenceClassification for predictions without further training.\n"
|
60 |
+
]
|
61 |
+
},
|
62 |
+
{
|
63 |
+
"data": {
|
64 |
+
"application/vnd.jupyter.widget-view+json": {
|
65 |
+
"model_id": "bfb51231c3ee4b6a9ab5811331baf689",
|
66 |
+
"version_major": 2,
|
67 |
+
"version_minor": 0
|
68 |
+
},
|
69 |
+
"text/plain": [
|
70 |
+
"Downloading: 0%| | 0.00/48.0 [00:00<?, ?B/s]"
|
71 |
+
]
|
72 |
+
},
|
73 |
+
"metadata": {},
|
74 |
+
"output_type": "display_data"
|
75 |
+
},
|
76 |
+
{
|
77 |
+
"data": {
|
78 |
+
"application/vnd.jupyter.widget-view+json": {
|
79 |
+
"model_id": "50e43a0ab3154a16ad623cad2c8637d6",
|
80 |
+
"version_major": 2,
|
81 |
+
"version_minor": 0
|
82 |
+
},
|
83 |
+
"text/plain": [
|
84 |
+
"Downloading: 0%| | 0.00/226k [00:00<?, ?B/s]"
|
85 |
+
]
|
86 |
+
},
|
87 |
+
"metadata": {},
|
88 |
+
"output_type": "display_data"
|
89 |
+
},
|
90 |
+
{
|
91 |
+
"data": {
|
92 |
+
"text/plain": [
|
93 |
+
"[{'label': 'POSITIVE', 'score': 0.9997795224189758}]"
|
94 |
+
]
|
95 |
+
},
|
96 |
+
"execution_count": 2,
|
97 |
+
"metadata": {},
|
98 |
+
"output_type": "execute_result"
|
99 |
+
}
|
100 |
+
],
|
101 |
+
"source": [
|
102 |
+
"classifier = pipeline(\"sentiment-analysis\")\n",
|
103 |
+
"classifier(\"We are very happy to show you the 🤗 Transformers library.\")"
|
104 |
+
]
|
105 |
+
},
|
106 |
+
{
|
107 |
+
"cell_type": "code",
|
108 |
+
"execution_count": null,
|
109 |
+
"metadata": {},
|
110 |
+
"outputs": [],
|
111 |
+
"source": []
|
112 |
+
}
|
113 |
+
],
|
114 |
+
"metadata": {
|
115 |
+
"kernelspec": {
|
116 |
+
"display_name": "Python 3.10.6 ('augmented_poetry')",
|
117 |
+
"language": "python",
|
118 |
+
"name": "python3"
|
119 |
+
},
|
120 |
+
"language_info": {
|
121 |
+
"codemirror_mode": {
|
122 |
+
"name": "ipython",
|
123 |
+
"version": 3
|
124 |
+
},
|
125 |
+
"file_extension": ".py",
|
126 |
+
"mimetype": "text/x-python",
|
127 |
+
"name": "python",
|
128 |
+
"nbconvert_exporter": "python",
|
129 |
+
"pygments_lexer": "ipython3",
|
130 |
+
"version": "3.8.13"
|
131 |
+
},
|
132 |
+
"orig_nbformat": 4,
|
133 |
+
"vscode": {
|
134 |
+
"interpreter": {
|
135 |
+
"hash": "00664817f4a09ab74dd392ee5a8d12e3606381c26df296db9ea5c334bb5d1b65"
|
136 |
+
}
|
137 |
+
}
|
138 |
+
},
|
139 |
+
"nbformat": 4,
|
140 |
+
"nbformat_minor": 2
|
141 |
+
}
|
test.py
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
print("hello")
|