Skip to content

Commit

Permalink
bugfix in inference after deployment (#3144)
Browse files Browse the repository at this point in the history
* bugfix in inference after deployment

* fix formatting
  • Loading branch information
jpmann committed Apr 26, 2024
1 parent 23d5c89 commit e81924b
Showing 1 changed file with 2 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@
"}\n",
"test_json = {\n",
" \"input_data\": {\n",
" \"input_string\": list(test_df[\"messages\"][0]),\n",
" \"input_string\": [test_df[\"messages\"][0]],\n",
" \"parameters\": parameters,\n",
" },\n",
" \"params\": {},\n",
Expand All @@ -665,22 +665,7 @@
" deployment_name=\"demo\",\n",
" request_file=\"./ultrachat_200k_dataset/sample_score.json\",\n",
")\n",
"print(\"raw response: \\n\", response, \"\\n\")\n",
"# convert the response to a pandas dataframe and rename the label column as scored_label\n",
"response_df = pd.read_json(response)\n",
"response_df = response_df.rename(columns={0: \"scored_label\"})\n",
"response_df.head(2)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# merge the test dataframe and the response dataframe on the index\n",
"merged_df = pd.merge(test_df, response_df, left_index=True, right_index=True)\n",
"merged_df.head(2)"
"print(\"raw response: \\n\", response, \"\\n\")"
]
},
{
Expand Down

0 comments on commit e81924b

Please sign in to comment.