Skip to content

Commit

Permalink
Remove redundant files
Browse files Browse the repository at this point in the history
  • Loading branch information
BeibinLi committed Jan 3, 2024
1 parent 791c4e0 commit eddcb33
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 157 deletions.
95 changes: 9 additions & 86 deletions notebook/agentchat_lmm_gpt-4v.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "0b7fc18e",
"id": "6868785c",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -335,7 +335,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 7,
"id": "977b9017",
"metadata": {
"scrolled": false
Expand Down Expand Up @@ -664,7 +664,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 8,
"id": "f0a58827",
"metadata": {},
"outputs": [],
Expand All @@ -691,7 +691,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 9,
"id": "56bd5742",
"metadata": {
"scrolled": false
Expand Down Expand Up @@ -773,15 +773,15 @@
},
{
"cell_type": "code",
"execution_count": 12,
"id": "0fe6917a",
"execution_count": 10,
"id": "00bd473d",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"defaultdict(list,\n",
" {<autogen.agentchat.groupchat.GroupChatManager at 0x7f7a2040dd00>: [{'content': [{'type': 'text',\n",
" {<autogen.agentchat.groupchat.GroupChatManager at 0x7f690545b820>: [{'content': [{'type': 'text',\n",
" 'text': 'Describe the image:\\n '},\n",
" {'type': 'image_url',\n",
" 'image_url': {'url': <PIL.Image.Image image mode=RGB size=1920x1080>}},\n",
Expand All @@ -802,7 +802,7 @@
" 'role': 'user'}]})"
]
},
"execution_count": 12,
"execution_count": 10,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -814,87 +814,10 @@
{
"cell_type": "code",
"execution_count": null,
"id": "04115031",
"id": "39d293fb",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 18,
"id": "b71c029f",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x05\\x08\\x06\\x00\\x00\\x00\\x8do&\\xe5\\x00\\x00\\x00\\x1cIDAT\\x08\\xd7c\\xf8\\xff\\xff?\\xc3\\x7f\\x06 \\x05\\xc3 \\x12\\x84\\xd01\\xf1\\x82X\\xcd\\x04\\x00\\x0e\\xf55\\xcb\\xd1\\x8e\\x0e\\x1f\\x00\\x00\\x00\\x00IEND\\xaeB`\\x82'\n",
"b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x05\\x08\\x06\\x00\\x00\\x00\\x8do&\\xe5\\x00\\x00\\x00&IDATx\\x9c}\\xc81\\x12\\x00\\x10\\x00\\xc0\\xb0\\xd6\\xff\\xff\\\\\\x0b\\xe7\\x18d\\x8c\\x15hl\\xa5\\xc1\\x89e\\xbc\\xf1\\xc9\\xf2\\x9ar\\x02\\x10k\\x0c\\x02\\xf3\\x0f\\xba=\\x00\\x00\\x00\\x00IEND\\xaeB`\\x82'\n"
]
},
{
"ename": "AssertionError",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[18], line 27\u001b[0m\n\u001b[1;32m 24\u001b[0m \u001b[38;5;28mprint\u001b[39m(image_data)\n\u001b[1;32m 25\u001b[0m \u001b[38;5;28mprint\u001b[39m(recovered_content)\n\u001b[0;32m---> 27\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m image_data \u001b[38;5;241m==\u001b[39m recovered_content\n",
"\u001b[0;31mAssertionError\u001b[0m: "
]
}
],
"source": [
"import base64\n",
"import copy\n",
"import mimetypes\n",
"import re\n",
"from io import BytesIO\n",
"from typing import Any, Dict, List, Optional, Tuple, Union\n",
"\n",
"import requests\n",
"from PIL import Image\n",
"\n",
"\n",
"raw_encoded_image = (\n",
" \"iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4\"\n",
" \"//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==\"\n",
")\n",
"image_data = base64.b64decode(raw_encoded_image)\n",
"image = Image.open(BytesIO(image_data))\n",
"\n",
"\n",
"buffered = BytesIO()\n",
"image.save(buffered, format=\"PNG\")\n",
"recovered_content = buffered.getvalue()\n",
"\n",
"print(image_data)\n",
"print(recovered_content)\n",
"\n",
"assert image_data == recovered_content"
]
},
{
"cell_type": "code",
"execution_count": 16,
"id": "ff4701db",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"b'\\x89PNG\\r\\n\\x1a\\n\\x00\\x00\\x00\\rIHDR\\x00\\x00\\x00\\x05\\x00\\x00\\x00\\x05\\x08\\x06\\x00\\x00\\x00\\x8do&\\xe5\\x00\\x00\\x00\\x1cIDAT\\x08\\xd7c\\xf8\\xff\\xff?\\xc3\\x7f\\x06 \\x05\\xc3 \\x12\\x84\\xd01\\xf1\\x82X\\xcd\\x04\\x00\\x0e\\xf55\\xcb\\xd1\\x8e\\x0e\\x1f\\x00\\x00\\x00\\x00IEND\\xaeB`\\x82'"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"image_data"
]
}
],
"metadata": {
Expand Down
30 changes: 0 additions & 30 deletions notebook/plot_temperatures.py

This file was deleted.

41 changes: 0 additions & 41 deletions notebook/plot_temperatures_improved.py

This file was deleted.

0 comments on commit eddcb33

Please sign in to comment.