v3.0
馃敟 Gradio 3.0 is the biggest update to the library, ever.
Here's what's new:
1. Blocks 馃П
Blocks is a new, low-level API that allows you to have full control over the data flows and layout of your application. It allows you to build very complex, multi-step applications. For example, you might want to:
- Group together related demos as multiple tabs in one web app
- Change the layout of your demo instead of just having all of the inputs on the left and outputs on the right
- Have multi-step interfaces, in which the output of one model becomes the input to the next model, or have more flexible data flows in general
- Change a component's properties (for example, the choices in a Dropdown) or its visibility based on user input
Here's a simple example that creates the demo below it:
import gradio as gr
def update(name):
return f"Welcome to Gradio, {name}!"
demo = gr.Blocks()
with demo:
gr.Markdown(
"""
# Hello World!
Start typing below to see the output.
""")
inp = gr.Textbox(placeholder="What is your name?")
out = gr.Textbox()
inp.change(fn=update,
inputs=inp,
outputs=out)
demo.launch()
Read our Introduction to Blocks guide for more, and join the 馃巿 Gradio Blocks Party!
2. Our Revamped Design 馃帹
We've upgraded our design across the entire library: from components, and layouts all the way to dark mode.
3. A New Website 馃捇
We've upgraded gradio.app to make it cleaner, faster and easier to use. Our docs now come with components and demos embedded directly on the page. So you can quickly get up to speed with what you're looking for.
4. New Components: Model3D, Dataset, and More..
We've introduced a lot of new components in 3.0
, including Model3D
, Dataset
, Markdown
, Button
and Gallery
. You can find all the components and play around with them here.
Full change log below:
What's Changed
- Gradio dash fe by @pngwn in #807
- Blocks components by @farukozderim in #765
- Blocks components V2 by @farukozderim in #843
- Blocks-Backend-Events by @farukozderim in #844
- Interfaces from Blocks by @aliabid94 in #849
- Blocks dev by @aliabid94 in #853
- Started updating demos to use the new
gradio.components
syntax by @abidlabs in #848 - add test infra + add browser tests to CI by @pngwn in #852
- 854 textbox by @pngwn in #859
- Getting old Python unit tests to pass on
blocks-dev
by @abidlabs in #861 - initialise chatbot with empty array of messages by @pngwn in #867
- add test for output to input by @pngwn in #866
- More Interface -> Blocks features by @aliabid94 in #864
- Fixing external.py in blocks-dev to reflect the new HF Spaces paths by @abidlabs in #879
- backend_default_value_refactoring by @farukozderim in #871
- fix default_value by @pngwn in #869
- fix buttons by @aliabid94 in #883
- Checking and updating more demos to use 3.0 syntax by @abidlabs in #892
- Blocks Tests by @farukozderim in #902
- Interface fix by @pngwn in #901
- Quick fix: Issue 893 by @dawoodkhan82 in #907
- 3d Image Component by @dawoodkhan82 in #775
- fix endpoint url in prod by @pngwn in #911
- rename Model3d to Image3D by @dawoodkhan82 in #912
- update pypi to 2.9.1 by @abidlabs in #916
- blocks-with-fix by @farukozderim in #917
- Restore Interpretation, Live, Auth, Queueing by @aliabid94 in #915
- Allow
Blocks
instances to be used like aBlock
in otherBlocks
by @abidlabs in #919 - Redesign 1 by @pngwn in #918
- blocks-components-tests by @farukozderim in #904
- fix unit + browser tests by @pngwn in #926
- blocks-move-test-data by @farukozderim in #927
- remove debounce from form inputs by @pngwn in #932
- reimplement webcam video by @pngwn in #928
- blocks-move-test-data by @farukozderim in #941
- allow audio components to take a string value by @pngwn in #930
- static mode for textbox by @pngwn in #929
- fix file upload text by @pngwn in #931
- tabbed-interface-rewritten by @farukozderim in #958
- Gan demo fix by @abidlabs in #965
- Blocks analytics by @abidlabs in #947
- Blocks page load by @farukozderim in #963
- add frontend for page load events by @pngwn in #967
- fix i18n and some tweaks by @pngwn in #966
- add jinja2 to reqs by @farukozderim in #969
- Cleaning up
Launchable()
by @abidlabs in #968 - Fix #944 by @farukozderim in #971
- New Blocks Demo: neural instrument cloning by @abidlabs in #975
- Add huggingface_hub client library by @farukozderim in #973
- State and variables by @aliabid94 in #977
- update-components by @farukozderim in #986
- ensure dataframe updates as expected by @pngwn in #981
- test-guideline by @farukozderim in #990
- Issue #785: add footer by @dawoodkhan82 in #972
- indentation fix by @abidlabs in #993
- missing quote by @aliabd in #996
- added interactive parameter to components by @abidlabs in #992
- custom-components by @farukozderim in #985
- Refactor component shortcuts by @farukozderim in #995
- Plot Component by @dawoodkhan82 in #805
- updated PyPi version to 2.9.2 by @abidlabs in #1002
- Release 2.9.3 by @abidlabs in #1003
- Image3D Examples Fix by @dawoodkhan82 in #1001
- release 2.9.4 by @abidlabs in #1006
- templates import hotfix by @farukozderim in #1008
- Progress indicator bar by @aliabid94 in #997
- Fixed image input for absolute path by @JefferyChiang in #1004
- Model3D + Plot Components by @dawoodkhan82 in #1010
- Gradio Guides: Creating CryptoPunks with GANs by @NimaBoscarino in #1000
- [BIG PR] Gradio blocks & redesigned components by @abidlabs in #880
- fixed failing test on main by @abidlabs in #1023
- Use smaller ASR model in external test by @abidlabs in #1024
- updated PyPi version to 2.9.0b by @abidlabs in #1026
- Fixing import issues so that the package successfully installs on colab notebooks by @abidlabs in #1027
- Update website tracker slackbot by @aliabd in #1037
- textbox-autoheight by @farukozderim in #1009
- Model3D Examples fixes by @dawoodkhan82 in #1035
- GAN Gradio Guide: Adjustments to iframe heights by @NimaBoscarino in #1042
- added better default labels to form components by @abidlabs in #1040
- Slackbot web tracker fix by @aliabd in #1043
- Plot fixes by @dawoodkhan82 in #1044
- Small fixes to the demos by @abidlabs in #1030
- fixing demo issue with website by @aliabd in #1047
- [hotfix] HighlightedText by @aliabid94 in #1046
- Update text by @ronvoluted in #1050
- Update CONTRIBUTING.md by @farukozderim in #1052
- fix(ui): Increase contrast for footer by @ronvoluted in #1048
- UI design update by @gary149 in #1041
- updated PyPi version to 2.9.0b8 by @abidlabs in #1059
- Running, testing, and fixing demos by @abidlabs in #1060
- Form layout by @pngwn in #1054
- inputless-interfaces by @farukozderim in #1038
- Update PULL_REQUEST_TEMPLATE.md by @farukozderim in #1068
- Upgrading node memory to 4gb in website Docker by @aliabd in #1069
- Website reload error by @aliabd in #1079
- fixed favicon issue by @abidlabs in #1064
- remove-queue-from-events by @farukozderim in #1056
- Enable vertex colors for OBJs files by @radames in #1074
- Dark text by @ronvoluted in #1049
- Scroll to output by @pngwn in #1077
- Explicitly list pnpm version 6 in contributing guide by @freddyaboulton in #1085
- hotfix for encrypt issue by @abidlabs in #1096
- Release 2.9b9 by @abidlabs in #1098
- tweak node circleci settings by @pngwn in #1091
- Website Reload Error by @aliabd in #1099
- Website Reload: README in demos docker by @aliabd in #1100
- Flagging fixes by @abidlabs in #1081
- Backend for optional labels by @abidlabs in #1080
- Optional labels fe by @pngwn in #1105
- clean-deprecated-parameters by @farukozderim in #1090
- Blocks rendering fix by @abidlabs in #1102
- Redos #1106 by @abidlabs in #1112
- Interface types: handle input-only, output-only, and unified interfaces by @abidlabs in #1108
- Hotfix + New pypi release 2.9b11 by @abidlabs in #1118
- issue-checkbox by @farukozderim in #1122
- issue-checkbox-hotfix by @farukozderim in #1127
- Fix demos in website by @aliabd in #1130
- Guide for Gradio ONNX model zoo on Huggingface by @AK391 in #1073
- ONNX guide fixes by @aliabd in #1131
- Stacked form inputs css by @gary149 in #1134
- made default value in textbox empty string by @abidlabs in #1135
- Examples UI by @gary149 in #1121
- Chatbot custom color support by @dawoodkhan82 in #1092
- highlighted text colors by @pngwn in #1119
- pin to pnpm 6 for now by @pngwn in #1147
- Restore queue in Blocks by @aliabid94 in #1137
- add select event for tabitems by @pngwn in #1154
- max_lines + autoheight for textbox by @pngwn in #1153
- use color palette for chatbot by @pngwn in #1152
- Timeseries improvements by @pngwn in #1149
- move styling for interface panels to frontend by @pngwn in #1146
- html tweaks by @pngwn in #1145
- Issue #768: Support passing none to resize and crop image by @dawoodkhan82 in #1144
- image gallery component + img css by @aliabid94 in #1140
- networking tweak by @abidlabs in #1143
- Allow enabling queue per event listener by @aliabid94 in #1155
- config hotfix and v. 2.9b23 by @abidlabs in #1158
- Custom JS calls by @aliabid94 in #1082
- Small fixes: queue default fix, ffmpeg installation message by @abidlabs in #1159
- formatting by @abidlabs in #1161
- enable flex grow for gr-box by @radames in #1165
- 1148 loading by @pngwn in #1164
- Put enable_queue kwarg back in launch() by @aliabid94 in #1167
- A few small fixes by @abidlabs in #1171
- Hotfix for dropdown component by @abidlabs in #1172
- use secondary buttons in interface by @pngwn in #1173
- 1183 component height by @pngwn in #1185
- 962 dataframe by @pngwn in #1186
- update-contributing by @farukozderim in #1188
- Table tweaks by @pngwn in #1195
- wrap tab content in column by @pngwn in #1200
- WIP: Add dark mode support by @gary149 in #1187
- Restored /api/predict/ endpoint for Interfaces by @abidlabs in #1199
- hltext-label by @pngwn in #1204
- add copy functionality to json by @pngwn in #1205
- Update component config by @aliabid94 in #1089
- fix placeholder prompt by @pngwn in #1215
- ensure webcam video value is propogated correctly by @pngwn in #1218
- Automatic word-break in highlighted text, combine_adjacent support by @aliabid94 in #1209
- async-function-support by @farukozderim in #1190
- Sharing fix for assets by @aliabid94 in #1208
- Hotfixes for course demos by @abidlabs in #1222
- Allow Custom CSS by @aliabid94 in #1170
- share-hotfix by @farukozderim in #1226
- tweaks by @pngwn in #1229
- white space for class concatenation by @radames in #1228
- Tweaks by @pngwn in #1230
- css tweaks by @pngwn in #1235
- ensure defaults height match for media inputs by @pngwn in #1236
- Default Label label value by @radames in #1239
- update-shortcut-syntax by @farukozderim in #1234
- Update version.txt by @farukozderim in #1244
- Layout bugs by @pngwn in #1246
- Update demo by @farukozderim in #1253
- Button default name by @farukozderim in #1243
- Labels spacing by @gary149 in #1254
- add global loader for gradio app by @pngwn in #1251
- ui apis for dalle-mini by @pngwn in #1258
- Add precision to Number, backend only by @freddyaboulton in #1125
- Website Design Changes by @abidlabs in #1015
- Small fixes for multiple demos compatible with 3.0 by @radames in #1257
- Issue #1160: Model 3D component not destroyed correctly by @dawoodkhan82 in #1219
- Fixes to components by @abidlabs in #1260
- layout docs by @abidlabs in #1263
- Static forms by @pngwn in #1264
- Cdn assets by @pngwn in #1265
- update logo by @gary149 in #1266
- fix slider by @aliabid94 in #1268
- maybe fix auth in iframes by @pngwn in #1261
- Improves "Getting Started" guide by @abidlabs in #1269
- Add embedded demos to website by @aliabid94 in #1270
- Label hotfixes by @abidlabs in #1281
- General tweaks by @pngwn in #1276
- only affect links within the document by @pngwn in #1282
- release 3.0b9 by @abidlabs in #1283
- Dm by @pngwn in #1284
- Website fixes by @aliabd in #1286
- Create Streamables by @aliabid94 in #1279
- ensure table works on mobile by @pngwn in #1277
- changes by @aliabid94 in #1287
- demo alignment on landing page by @aliabd in #1288
- New meta img by @aliabd in #1289
- updated PyPi version to 3.0 by @abidlabs in #1290
- Fix site by @aliabid94 in #1291
- Mobile responsive guides by @aliabd in #1293
- Update readme by @abidlabs in #1292
- gif by @abidlabs in #1296
New Contributors
- @JefferyChiang made their first contribution in #1004
- @NimaBoscarino made their first contribution in #1000
- @ronvoluted made their first contribution in #1050
- @radames made their first contribution in #1074
- @freddyaboulton made their first contribution in #1085
Full Changelog: v2.9.0...v3.0