Browse Source

Updated due to breaking change in Gradio v5

pull/14/head
Edward Donner 6 months ago
parent
commit
7aeb18a3df
  1. 7
      week8/day5.ipynb
  2. 2
      week8/price_is_right.py

7
week8/day5.ipynb

@ -49,6 +49,9 @@
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"source": [ "source": [
"# Updated to change from height to max_height due to change in Gradio v5\n",
"# With much thanks to student Ed B. for raising this\n",
"\n",
"with gr.Blocks(title=\"The Price is Right\", fill_width=True) as ui:\n", "with gr.Blocks(title=\"The Price is Right\", fill_width=True) as ui:\n",
"\n", "\n",
" initial_deal = Deal(product_description=\"Example description\", price=100.0, url=\"https://cnn.com\")\n", " initial_deal = Deal(product_description=\"Example description\", price=100.0, url=\"https://cnn.com\")\n",
@ -69,7 +72,7 @@
" column_widths=[4, 1, 1, 1, 2],\n", " column_widths=[4, 1, 1, 1, 2],\n",
" row_count=10,\n", " row_count=10,\n",
" col_count=5,\n", " col_count=5,\n",
" height=400,\n", " max_height=400,\n",
" )\n", " )\n",
"\n", "\n",
" ui.load(get_table, inputs=[opportunities], outputs=[opportunities_dataframe])\n", " ui.load(get_table, inputs=[opportunities], outputs=[opportunities_dataframe])\n",
@ -111,7 +114,7 @@
" column_widths=[4, 1, 1, 1, 2],\n", " column_widths=[4, 1, 1, 1, 2],\n",
" row_count=10,\n", " row_count=10,\n",
" col_count=5,\n", " col_count=5,\n",
" height=400,\n", " max_height=400,\n",
" )\n", " )\n",
"\n", "\n",
" ui.load(get_table, inputs=[opportunities], outputs=[opportunities_dataframe])\n", " ui.load(get_table, inputs=[opportunities], outputs=[opportunities_dataframe])\n",

2
week8/price_is_right.py

@ -44,7 +44,7 @@ class App:
column_widths=[4, 1, 1, 1, 2], column_widths=[4, 1, 1, 1, 2],
row_count=10, row_count=10,
col_count=5, col_count=5,
height=400, max_height=400,
) )
ui.load(start, inputs=[], outputs=[opportunities_dataframe]) ui.load(start, inputs=[], outputs=[opportunities_dataframe])

Loading…
Cancel
Save