Skip to content

Commit

Permalink
move to legacy: weave_internal
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtruong committed Aug 27, 2024
1 parent 7843a2e commit fac7737
Show file tree
Hide file tree
Showing 97 changed files with 305 additions and 313 deletions.
308 changes: 154 additions & 154 deletions Eval Board.ipynb
Original file line number Diff line number Diff line change
@@ -1,161 +1,161 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 61,
"id": "314bb6b4",
"metadata": {},
"outputs": [],
"source": [
"import typing\n",
"\n",
"import weave\n",
"from weave import weave_internal\n",
"\n",
"weave.use_frontend_devmode()\n",
"from weave.legacy import ops_domain\n",
"from weave.legacy.panels import panel_board"
]
},
{
"cell_type": "code",
"execution_count": 62,
"id": "550daef6",
"metadata": {},
"outputs": [],
"source": [
"@weave.type()\n",
"class Dataset:\n",
" rows: list[typing.Any]"
]
},
{
"cell_type": "code",
"execution_count": 64,
"id": "e8065ad6",
"metadata": {},
"outputs": [
"cells": [
{
"cell_type": "code",
"execution_count": 61,
"id": "314bb6b4",
"metadata": {},
"outputs": [],
"source": [
"import typing\n",
"\n",
"import weave\n",
"from weave.legacy import weave_internal\n",
"\n",
"weave.use_frontend_devmode()\n",
"from weave.legacy import ops_domain\n",
"from weave.legacy.panels import panel_board"
]
},
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"400px\"\n",
" src=\"http://localhost:3000/__frontend/weave_jupyter?fullScreen&expNode=%7B%22nodeType%22%3A%20%22output%22%2C%20%22type%22%3A%20%22any%22%2C%20%22fromOp%22%3A%20%7B%22name%22%3A%20%22get%22%2C%20%22inputs%22%3A%20%7B%22uri%22%3A%20%7B%22nodeType%22%3A%20%22const%22%2C%20%22type%22%3A%20%22string%22%2C%20%22val%22%3A%20%22local-artifact%3A///dashboard-Group0%3Alatest/obj%22%7D%7D%7D%7D\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" allow=\"clipboard-write\"\n",
" ></iframe>\n",
" "
"cell_type": "code",
"execution_count": 62,
"id": "550daef6",
"metadata": {},
"outputs": [],
"source": [
"@weave.type()\n",
"class Dataset:\n",
" rows: list[typing.Any]"
]
},
{
"cell_type": "code",
"execution_count": 64,
"id": "e8065ad6",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"\n",
" <iframe\n",
" width=\"100%\"\n",
" height=\"400px\"\n",
" src=\"http://localhost:3000/__frontend/weave_jupyter?fullScreen&expNode=%7B%22nodeType%22%3A%20%22output%22%2C%20%22type%22%3A%20%22any%22%2C%20%22fromOp%22%3A%20%7B%22name%22%3A%20%22get%22%2C%20%22inputs%22%3A%20%7B%22uri%22%3A%20%7B%22nodeType%22%3A%20%22const%22%2C%20%22type%22%3A%20%22string%22%2C%20%22val%22%3A%20%22local-artifact%3A///dashboard-Group0%3Alatest/obj%22%7D%7D%7D%7D\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" allow=\"clipboard-write\"\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2dbee55b0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x2dbee55b0>"
"source": [
"varbar = panel_board.varbar()\n",
"\n",
"entity_name_val = varbar.add(\"entity_name_val\", \"shawn\", hidden=True)\n",
"entity = ops_domain.entity(entity_name_val)\n",
"entity_name = varbar.add(\n",
" \"entity_name\",\n",
" weave.legacy.panels.Dropdown(\n",
" entity_name_val, choices=ops_domain.viewer().entities().name()\n",
" ),\n",
")\n",
"\n",
"project_name_val = varbar.add(\"project_name_val\", \"weave-flow1\", hidden=True)\n",
"project = ops_domain.project(entity_name_val, project_name_val)\n",
"project_name = varbar.add(\n",
" \"project_name\",\n",
" weave.legacy.panels.Dropdown(project_name_val, choices=entity.projects().name()),\n",
")\n",
"\n",
"dataset_name_val = varbar.add(\"dataset_name_val\", \"my_dataset1\", hidden=True)\n",
"dataset = varbar.add(\n",
" \"dataset\",\n",
" weave.legacy.ops.get(\n",
" weave_internal.const(\"wandb-artifact:///\")\n",
" + entity_name_val\n",
" + \"/\"\n",
" + project_name_val\n",
" + \"/\"\n",
" + dataset_name_val\n",
" + \":latest/obj\"\n",
" ),\n",
" hidden=True,\n",
")\n",
"dataset_ref = varbar.add(\n",
" \"dataset_ref\",\n",
" weave.legacy.ops.ref(\n",
" weave_internal.const(\"wandb-artifact:///\")\n",
" + entity_name_val\n",
" + \"/\"\n",
" + project_name_val\n",
" + \"/\"\n",
" + dataset_name_val\n",
" + \":latest/obj\"\n",
" ),\n",
")\n",
"dataset_name = varbar.add(\n",
" \"dataset_name\",\n",
" weave.legacy.panels.Dropdown(\n",
" dataset_name_val, choices=project.artifactType(\"Dataset\").artifacts().name()\n",
" ),\n",
")\n",
"\n",
"# Now here I want to pick model A and model B\n",
"# I need to a way to get to artifact from an object, like get_ref.artifact ?\n",
"# like dataset_ref.artifact().usedBy().filter(lambda row: row.jobName() == 'eval')\n",
"# then from there find consuming runs of a given job_type (\"eval\")\n",
"# let the user pick two of those\n",
"\n",
"# want a really nice data grid of the table metric comparsion per row\n",
"\n",
"main = weave.legacy.panels.Group(\n",
" layoutMode=\"grid\",\n",
" showExpressions=True,\n",
" enableAddPanel=True,\n",
")\n",
"\n",
"main.add(\"ename\", entity_name_val)\n",
"main.add(\"pname\", project_name_val)\n",
"main.add(\"dsrows\", weave.legacy.ops.obj_getattr(dataset, \"rows\"))\n",
"# main.add(\"artifact\", dataset_ref.artifact())\n",
"\n",
"# I Need a programmable Table. One that's columns are defined by Nodes\n",
"# Same for panels, I want to be able to generate a bunch of panels\n",
"# Can I do this with Weaveify?\n",
"# Like I can pass a function in in the Board that returns the panel I want maybe?\n",
"\n",
"weave.legacy.panels.Board(vars=varbar, panels=main)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"varbar = panel_board.varbar()\n",
"\n",
"entity_name_val = varbar.add(\"entity_name_val\", \"shawn\", hidden=True)\n",
"entity = ops_domain.entity(entity_name_val)\n",
"entity_name = varbar.add(\n",
" \"entity_name\",\n",
" weave.legacy.panels.Dropdown(\n",
" entity_name_val, choices=ops_domain.viewer().entities().name()\n",
" ),\n",
")\n",
"\n",
"project_name_val = varbar.add(\"project_name_val\", \"weave-flow1\", hidden=True)\n",
"project = ops_domain.project(entity_name_val, project_name_val)\n",
"project_name = varbar.add(\n",
" \"project_name\",\n",
" weave.legacy.panels.Dropdown(project_name_val, choices=entity.projects().name()),\n",
")\n",
"\n",
"dataset_name_val = varbar.add(\"dataset_name_val\", \"my_dataset1\", hidden=True)\n",
"dataset = varbar.add(\n",
" \"dataset\",\n",
" weave.legacy.ops.get(\n",
" weave_internal.const(\"wandb-artifact:///\")\n",
" + entity_name_val\n",
" + \"/\"\n",
" + project_name_val\n",
" + \"/\"\n",
" + dataset_name_val\n",
" + \":latest/obj\"\n",
" ),\n",
" hidden=True,\n",
")\n",
"dataset_ref = varbar.add(\n",
" \"dataset_ref\",\n",
" weave.legacy.ops.ref(\n",
" weave_internal.const(\"wandb-artifact:///\")\n",
" + entity_name_val\n",
" + \"/\"\n",
" + project_name_val\n",
" + \"/\"\n",
" + dataset_name_val\n",
" + \":latest/obj\"\n",
" ),\n",
")\n",
"dataset_name = varbar.add(\n",
" \"dataset_name\",\n",
" weave.legacy.panels.Dropdown(\n",
" dataset_name_val, choices=project.artifactType(\"Dataset\").artifacts().name()\n",
" ),\n",
")\n",
"\n",
"# Now here I want to pick model A and model B\n",
"# I need to a way to get to artifact from an object, like get_ref.artifact ?\n",
"# like dataset_ref.artifact().usedBy().filter(lambda row: row.jobName() == 'eval')\n",
"# then from there find consuming runs of a given job_type (\"eval\")\n",
"# let the user pick two of those\n",
"\n",
"# want a really nice data grid of the table metric comparsion per row\n",
"\n",
"main = weave.legacy.panels.Group(\n",
" layoutMode=\"grid\",\n",
" showExpressions=True,\n",
" enableAddPanel=True,\n",
")\n",
"\n",
"main.add(\"ename\", entity_name_val)\n",
"main.add(\"pname\", project_name_val)\n",
"main.add(\"dsrows\", weave.legacy.ops.obj_getattr(dataset, \"rows\"))\n",
"# main.add(\"artifact\", dataset_ref.artifact())\n",
"\n",
"# I Need a programmable Table. One that's columns are defined by Nodes\n",
"# Same for panels, I want to be able to generate a bunch of panels\n",
"# Can I do this with Weaveify?\n",
"# Like I can pass a function in in the Board that returns the panel I want maybe?\n",
"\n",
"weave.legacy.panels.Board(vars=varbar, panels=main)"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
}
},
"nbformat": 4,
"nbformat_minor": 5
"nbformat": 4,
"nbformat_minor": 5
}
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/Confusion Matrix.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"from PIL import Image\n",
"import weave\n",
"from weave.legacy import storage\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"#weave.use_frontend_devmode()"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/Diffusion explore 2.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"from weave.legacy.ecosystem.all import langchain\n",
"weave.use_frontend_devmode()"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/Diffusion explore.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"from weave.legacy.ecosystem.all import langchain"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/Diffusion story.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"from weave.legacy.ecosystem.all import langchain\n",
"weave.use_frontend_devmode()"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/art_explore.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"from weave.legacy.ecosystem.all import langchain"
]
},
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/skip_test/weave_scifi.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"from weave.legacy.ecosystem.all import langchain\n",
"weave.use_frontend_devmode()"
]
Expand Down
2 changes: 1 addition & 1 deletion examples/experimental/tag_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"outputs": [],
"source": [
"import weave\n",
"from weave import weave_internal"
"from weave.legacy import weave_internal"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion examples/reference/panels/plot/synced_axes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"outputs": [],
"source": [
"from weave.legacy.panels.panel_plot import Signals, AxisSelections, Plot\n",
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"\n",
"\n",
"domain_node = weave_internal.const(None)\n",
Expand Down
2 changes: 1 addition & 1 deletion examples/reference/vis/Distribution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"metadata": {},
"outputs": [],
"source": [
"from weave import weave_internal\n",
"from weave.legacy import weave_internal\n",
"# Numeric distribution\n",
"dist = wandb.Distribution(\n",
" items,\n",
Expand Down
Loading

0 comments on commit fac7737

Please sign in to comment.