AruniAnkur commited on
Commit
27aca3c
·
verified ·
1 Parent(s): 0a4e1a5

Update t5_training.ipynb

Browse files
Files changed (1) hide show
  1. t5_training.ipynb +2 -8
t5_training.ipynb CHANGED
@@ -25,6 +25,7 @@
25
  "from transformers import T5ForConditionalGeneration, T5Tokenizer\n",
26
  "from datasets import Dataset\n",
27
  "from transformers import Trainer, TrainingArguments\n",
 
28
  "\n",
29
  "# Load pre-trained FLAN-T5 model and tokenizer\n",
30
  "model_name = \"google/flan-t5-large\" # FLAN-T5 Base Model\n",
@@ -32,14 +33,7 @@
32
  "model = T5ForConditionalGeneration.from_pretrained(model_name)\n",
33
  "\n",
34
  "# Example input-output pair for fine-tuning\n",
35
- "data = {\n",
36
- " \"input_text\": [\n",
37
- " \"What are the key differences between classification and regression tasks in supervised learning, and how do you determine which algorithm to use for a specific problem? e How does clustering differ from dimensionality reduction, and can you provide real-world examples of where each is applied?\"\n",
38
- " ],\n",
39
- " \"output_text\": [\n",
40
- " \"@ What are the key differences between classification and regression tasks in supervised learning, and how do you determine which algorithm to use for a specific problem? @ How does clustering differ from dimensionality reduction, and can you provide real-world examples of where each is applied?\"\n",
41
- " ]\n",
42
- "}\n",
43
  "\n",
44
  "# Convert the data to a Hugging Face dataset\n",
45
  "dataset = Dataset.from_dict(data)\n",
 
25
  "from transformers import T5ForConditionalGeneration, T5Tokenizer\n",
26
  "from datasets import Dataset\n",
27
  "from transformers import Trainer, TrainingArguments\n",
28
+ "import json\n",
29
  "\n",
30
  "# Load pre-trained FLAN-T5 model and tokenizer\n",
31
  "model_name = \"google/flan-t5-large\" # FLAN-T5 Base Model\n",
 
33
  "model = T5ForConditionalGeneration.from_pretrained(model_name)\n",
34
  "\n",
35
  "# Example input-output pair for fine-tuning\n",
36
+ "data = json.load('t5train.json')\n",
 
 
 
 
 
 
 
37
  "\n",
38
  "# Convert the data to a Hugging Face dataset\n",
39
  "dataset = Dataset.from_dict(data)\n",