You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: contrib/hamilton/contrib/user/skrawcz/fine_tuning/README.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,7 @@ more responses that are more contextually relevant to your use case.
20
20
## FLAN LLM
21
21
This example is based on using [Google's Fine-tuned LAnguage Net (FLAN) models hosted on HuggingFace](https://huggingface.co/docs/transformers/model_doc/flan-t5).
22
22
The larger the model, the longer it will take to fine-tune, and the more memory you'll need for it. The code
23
-
here by default (which you can easily change) is set up to run on docker using the smallest FLAN model.
23
+
here was validated to run on docker using the smallest FLAN model ("model_id": "google/flan-t5-small") on a Mac that's a few years old.
24
24
25
25
## What type of functionality is in this module?
26
26
@@ -59,22 +59,23 @@ e.g. you should be able to do `json.load(f)` and it would return a list of dicti
59
59
]
60
60
```
61
61
62
-
You would then pass in as _inputs_ to execution `"data_path"=PATH_TO_THIS_FILE` as well as `"input_text_key"="question"` and `"output_text_key"="reply"`.
62
+
You would then pass in as _inputs_ to execution `"data_path":PATH_TO_THIS_FILE` as well as `"input_text_key":"question"` and `"output_text_key":"reply"`.
63
63
- Instantiate the driver. Use `{"start": "base"}` as configuration to run with to use a raw base LLM to finetune.
64
-
- Pick your LLM. `model_id_tokenizer="google/mt5-small"` is the default, but you can change it to any of the models
64
+
- Pick your LLM. `"model_id":"google/mt5-small"` is what we recommend to start, but you can change it to any of the models
65
65
that the transformers library supports for `AutoModelForSeq2SeqLM` models.
66
66
- Run the code.
67
67
68
68
```python
69
69
# instantiate the driver with this module however you want
70
70
result = dr.execute(
71
-
[ # some suggested outputs
71
+
[ # some suggested outputs -- see the visualization/code to understand what these are
72
72
"save_best_models",
73
73
"hold_out_set_predictions",
74
74
"training_and_validation_set_metrics",
75
75
"finetuned_model_on_validation_set",
76
76
],
77
77
inputs={
78
+
"model_id": "google/flan-t5-small", # the base model you want to fine-tune
78
79
"data_path": "example-support-dataset.json", # the path to your dataset
79
80
"input_text_key": "question", # the key in the json object that has the input text
80
81
"output_text_key": "gpt4_replies_target", # the key in the json object that has the target output text
0 commit comments