From 700f4bc05cf11225778de2e0952883b8ff87a10a Mon Sep 17 00:00:00 2001 From: altryne Date: Mon, 13 Jan 2025 17:55:23 -0700 Subject: [PATCH] Revert "Clean weave dashboard is coming" --- eval.ipynb | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/eval.ipynb b/eval.ipynb index 9b30b75..623dbf2 100644 --- a/eval.ipynb +++ b/eval.ipynb @@ -95,7 +95,7 @@ }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -151,12 +151,12 @@ " \n", " # Analyze the post\n", " #download the avatar and convert to PIL image\n", - " avatar_uri = post['post']['author'].get('avatar')\n", + " avatar_uri = post['post']['author']['avatar']\n", " avatar_response = requests.get(avatar_uri)\n", " avatar_pil = Image.open(io.BytesIO(avatar_response.content))\n", "\n", " response_dict = analyze_post_sentiment(avatar_pil, post['post']['author']['displayName'], post['post']['record']['text'])\n", - " analysis = response_dict['llm_classification']\n", + " analysis = response_dict['response'].choices[0].message.content\n", " weave_call_id = response_dict['weave_call_id']\n", " \n", " post_data = {\n", @@ -298,7 +298,7 @@ " weave_call_id = None\n", " \n", " return {\n", - " \"llm_classification\": response.choices[0].message.content,\n", + " \"response\": response,\n", " \"weave_call_id\": weave_call_id\n", " }\n", "\n", @@ -493,7 +493,7 @@ " call_dict = dict(call)\n", " row[\"input\"] = call_dict.get('inputs').get('text')\n", " row[\"displayName\"] = call_dict.get('inputs').get('displayName')\n", - " row[\"llm_classification\"] = call_dict.get('output').get('llm_classification')\n", + " row[\"llm_classification\"] = call_dict.get('output').get('response').get('choices')[0].get('message').get('content')\n", " list_of_feedback = call_dict.get('summary').get('weave').get('feedback')\n", " for feedback in list_of_feedback:\n", " if feedback.get(\"feedback_type\") == 'wandb.annotation.doomer_or_boomer':\n", @@ -505,11 +505,10 @@ " \n", " dataset.append(row)\n", "\n", - " # weave.publish(weave.Dataset(name=\"doomer_or_boomer_dataset\", rows=dataset))\n", + " weave.publish(weave.Dataset(name=\"doomer_or_boomer_dataset\", rows=dataset))\n", " return dataset\n", "\n", - "dataset = get_annotated_calls()\n", - "print(dataset)" + "dataset = get_annotated_calls()" ] }, {