Skip to content

Commit

Permalink
still bad
Browse files Browse the repository at this point in the history
  • Loading branch information
Hui Kang Tong committed Nov 2, 2024
1 parent db0c852 commit faf944f
Show file tree
Hide file tree
Showing 12 changed files with 2,973 additions and 3,145 deletions.
31 changes: 17 additions & 14 deletions classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
"- pandas\n",
"- scikit-learn\n",
"- anthropic\n",
"- openai"
"- openai\n",
"\n",
"Note: o1 may be sonnet in this notebook, I have not updated everything"
]
},
{
Expand Down Expand Up @@ -576,17 +578,18 @@
" \n",
" conversation_history.append({\"role\": \"user\", \"content\": user_message})\n",
" \n",
" response = openai_client.chat.completions.create(\n",
" model=\"o1-preview\",\n",
" messages=conversation_history\n",
" message = anthropic_client.messages.create(\n",
" model=\"claude-3-5-sonnet-20241022\",\n",
" max_tokens=4000,\n",
" messages=conversation_history,\n",
" )\n",
" \n",
" token_counts[\"o1_input\"] += response.usage.prompt_tokens\n",
" token_counts[\"o1_output\"] += response.usage.completion_tokens\n",
" token_costs[\"o1_input\"] += response.usage.prompt_tokens * 3 * 1e-6\n",
" token_costs[\"o1_output\"] += response.usage.completion_tokens * 15 * 1e-6\n",
" token_counts[\"sonnet_input\"] += message.usage.input_tokens\n",
" token_counts[\"sonnet_output\"] += message.usage.output_tokens\n",
" token_costs[\"sonnet_input\"] += message.usage.input_tokens * 3 * 1e-6\n",
" token_costs[\"sonnet_output\"] += message.usage.output_tokens * 15 * 1e-6\n",
"\n",
" parameters_update_response = response.choices[0].message.content\n",
" parameters_update_response = message.content[0].text\n",
"\n",
" for model_parameter_key in model_parameters.keys():\n",
" groups = re.search(\n",
Expand Down Expand Up @@ -1006,10 +1009,10 @@
"data": {
"text/plain": [
"defaultdict(int,\n",
" {'haiku_input': 240596,\n",
" 'haiku_output': 20808,\n",
" 'o1_input': 37424,\n",
" 'o1_output': 31341})"
" {'haiku_input': 117320,\n",
" 'haiku_output': 32972,\n",
" 'sonnet_input': 40721,\n",
" 'sonnet_output': 2651})"
]
},
"execution_count": 20,
Expand All @@ -1031,7 +1034,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Cost: $0.67\n"
"Cost: $0.23\n"
]
}
],
Expand Down
403 changes: 205 additions & 198 deletions html_output/iteration-classification-001-diff.html

Large diffs are not rendered by default.

820 changes: 410 additions & 410 deletions html_output/iteration-classification-001.html

Large diffs are not rendered by default.

393 changes: 200 additions & 193 deletions html_output/iteration-classification-002-diff.html

Large diffs are not rendered by default.

816 changes: 408 additions & 408 deletions html_output/iteration-classification-002.html

Large diffs are not rendered by default.

366 changes: 183 additions & 183 deletions html_output/iteration-classification-003-diff.html

Large diffs are not rendered by default.

816 changes: 408 additions & 408 deletions html_output/iteration-classification-003.html

Large diffs are not rendered by default.

328 changes: 143 additions & 185 deletions html_output/iteration-classification-004-diff.html

Large diffs are not rendered by default.

816 changes: 408 additions & 408 deletions html_output/iteration-classification-004.html

Large diffs are not rendered by default.

413 changes: 133 additions & 280 deletions html_output/iteration-classification-005-diff.html

Large diffs are not rendered by default.

820 changes: 410 additions & 410 deletions html_output/iteration-classification-005.html

Large diffs are not rendered by default.

96 changes: 48 additions & 48 deletions html_output/prompt-history-classification.html

Large diffs are not rendered by default.

0 comments on commit faf944f

Please sign in to comment.