Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
steventkrawczyk committed Sep 12, 2023
1 parent e89845e commit 9497015
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
18 changes: 14 additions & 4 deletions examples/notebooks/FineTuningExperiment.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,22 @@
"## Installations"
]
},
{
"cell_type": "markdown",
"id": "abbc7d2a",
"metadata": {},
"source": [
"You may need to install `prompttools`, `replicate`, and HuggingFace's `datasets` to complete this example."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "885dabeb",
"metadata": {},
"outputs": [],
"source": [
"# !pip install --quiet --force-reinstall prompttools"
"# !pip install --quiet --force-reinstall prompttools datasets replicate"
]
},
{
Expand Down Expand Up @@ -177,7 +185,7 @@
"source": [
"# Fine tuning GPT-3.5 on OpenAI\n",
"\n",
"First, we'll create and upload a file for our fine tuning rows, and fine tune the model."
"First, we'll create and upload a file for our fine tuning rows, and fine tune the model. The file processing may take a few minutes, and the fine tuning may take a few hours."
]
},
{
Expand Down Expand Up @@ -238,7 +246,7 @@
"metadata": {},
"outputs": [],
"source": [
"openai.FineTuningJob.create(training_file=\"file-name\", model=\"gpt-3.5-turbo\")"
"openai.FineTuningJob.create(training_file=\"YOUR_FILE_NAME_HERE\", model=\"gpt-3.5-turbo\")"
]
},
{
Expand Down Expand Up @@ -549,7 +557,9 @@
"source": [
"## Run fine tuning\n",
"\n",
"For replicate, you will need to upload your fine-tuning rows to an accessible URL. For our example, we uploaded the file to an S3 bucket and used a signed URL to provide access."
"For replicate, you will need to upload your fine-tuning rows to an accessible URL. For our example, we uploaded the file to an S3 bucket and used a signed URL to provide access.\n",
"\n",
"The fine tuning may take a few hours."
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions prompttools/experiment/experiments/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def _get_dynamic_columns(df: pd.DataFrame) -> pd.DataFrame:
unique_counts = df[hashable_columns].nunique()
columns_with_multiple_unique_values = unique_counts[unique_counts > 1].index
dfs_to_concat = [df[columns_with_multiple_unique_values], df[unhashable_columns]]
if 'prompt' in df:
if 'prompt' in df and 'prompt' not in dfs_to_concat:
dfs_to_concat.append(df['prompt'])
if 'messages' in df:
elif 'messages' in df and 'messages' not in dfs_to_concat:
dfs_to_concat.append(df['messages'])
return pd.concat(dfs_to_concat, axis=1)

0 comments on commit 9497015

Please sign in to comment.