diff --git a/gradio/outputs.py b/gradio/outputs.py index 1809cc4bc0..d976e15528 100644 --- a/gradio/outputs.py +++ b/gradio/outputs.py @@ -793,6 +793,7 @@ class Timeseries(OutputComponent): def restore_flagged(self, dir, data, encryption_key): return json.loads(data) + class Chatbot(OutputComponent): """ Component displays a chatbot output showing both user submitted messages and responses @@ -827,7 +828,6 @@ class Chatbot(OutputComponent): return y - class State(OutputComponent): """ Special hidden component that stores state across runs of the interface. diff --git a/render_readme.py b/render_readme.py index 2b922287af..e40304efbe 100644 --- a/render_readme.py +++ b/render_readme.py @@ -41,9 +41,7 @@ class GuidesLoader(BaseLoader): return source, path, lambda: mtime == getmtime(path) -readme_template = Environment(loader=GuidesLoader(".")).get_template( - README_TEMPLATE -) +readme_template = Environment(loader=GuidesLoader(".")).get_template(README_TEMPLATE) output_readme = readme_template.render(code=code, demos=demos) output_readme = output_readme.replace("(/assets/", "(website/homepage/src/assets/") diff --git a/test/golden/diff_texts/magic_trick.png b/test/golden/diff_texts/magic_trick.png index 86694f731b..14756b5403 100644 Binary files a/test/golden/diff_texts/magic_trick.png and b/test/golden/diff_texts/magic_trick.png differ diff --git a/test/golden/image_mod/cheetah1.png b/test/golden/image_mod/cheetah1.png index b82fb905ea..44dae86a2a 100644 Binary files a/test/golden/image_mod/cheetah1.png and b/test/golden/image_mod/cheetah1.png differ diff --git a/test/golden/longest_word/wonderful.png b/test/golden/longest_word/wonderful.png index 11fcd6dd0b..78954561dd 100644 Binary files a/test/golden/longest_word/wonderful.png and b/test/golden/longest_word/wonderful.png differ diff --git a/test/golden/sentence_builder/two_cats.png b/test/golden/sentence_builder/two_cats.png index 42e20cf71e..7b37a2ada5 100644 Binary files a/test/golden/sentence_builder/two_cats.png and b/test/golden/sentence_builder/two_cats.png differ diff --git a/ui/pnpm-lock.yaml b/ui/pnpm-lock.yaml index 658e37b257..e61ed23235 100644 --- a/ui/pnpm-lock.yaml +++ b/ui/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: svelte: 3.46.3 svelte-check: 2.4.1_svelte@3.46.3 svelte-i18n: 3.3.13_svelte@3.46.3 - vitest: 0.3.2 + vitest: 0.3.5 packages/app: specifiers: @@ -60,7 +60,7 @@ importers: postcss: 8.4.6 postcss-nested: 5.0.6_postcss@8.4.6 svelte: 3.46.3 - tailwindcss: 3.0.19_autoprefixer@9.8.8+postcss@8.4.6 + tailwindcss: 3.0.22_autoprefixer@9.8.8 vite: 2.7.13 packages/components: @@ -1120,19 +1120,7 @@ packages: optional: true /function-bind/1.1.1: -<<<<<<< HEAD -<<<<<<< HEAD - resolution: - { - integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - } -======= resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} ->>>>>>> parent of 2438b0bb (more pretty formatting) - dev: true -======= - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} ->>>>>>> master /gauge/3.0.2: resolution: {integrity: sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==} @@ -1720,10 +1708,6 @@ packages: /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} -<<<<<<< HEAD -======= - dev: true ->>>>>>> parent of 2438b0bb (more pretty formatting) /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} @@ -2065,22 +2049,8 @@ packages: dev: false /source-map-js/1.0.2: -<<<<<<< HEAD -<<<<<<< HEAD - resolution: - { - integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - } - engines: { node: ">=0.10.0" } -======= resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} engines: {node: '>=0.10.0'} ->>>>>>> parent of 2438b0bb (more pretty formatting) - dev: true -======= - resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} - engines: {node: '>=0.10.0'} ->>>>>>> master /source-map/0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} @@ -2165,22 +2135,8 @@ packages: dev: true /supports-preserve-symlinks-flag/1.0.0: -<<<<<<< HEAD -<<<<<<< HEAD - resolution: - { - integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - } - engines: { node: ">= 0.4" } -======= resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} ->>>>>>> parent of 2438b0bb (more pretty formatting) - dev: true -======= - resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} - engines: {node: '>= 0.4'} ->>>>>>> master /svelte-check/2.4.1_svelte@3.46.3: resolution: {integrity: sha512-xhf3ShP5rnRwBokrgTBJ/0cO9QIc1DAVu1NWNRTfCDsDBNjGmkS3HgitgUadRuoMKj1+irZR/yHJ+Uqobnkbrw==} @@ -2349,13 +2305,12 @@ packages: dev: false optional: true - /tailwindcss/3.0.19_autoprefixer@9.8.8+postcss@8.4.6: - resolution: {integrity: sha512-rjsdfz/qZya5xQ0OVynEMETgWq1CacmftgMYeXXh6bRM5vxsNwRSbMJsCCIjq/w67om9VP/AFMolOwiE+5VKig==} + /tailwindcss/3.0.22_autoprefixer@9.8.8: + resolution: {integrity: sha512-F8lt74RlNZirnkaSk310+vGQta7c0/hgx7/bqxruM4wS9lp8oqV93lzavajC3VT0Lp4UUtUVIt8ifKcmGzkr0A==} engines: {node: '>=12.13.0'} hasBin: true peerDependencies: autoprefixer: ^10.0.2 - postcss: ^8.0.9 dependencies: arg: 5.0.1 autoprefixer: 9.8.8 @@ -2396,13 +2351,13 @@ packages: dev: false optional: true -<<<<<<< HEAD /tiny-glob/0.2.9: resolution: {integrity: sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==} dependencies: globalyzer: 0.1.0 globrex: 0.1.2 -======= + dev: false + /tinypool/0.1.2: resolution: {integrity: sha512-fvtYGXoui2RpeMILfkvGIgOVkzJEGediv8UJt7TxdAOY8pnvUkFg/fkvqTfXG9Acc9S17Cnn1S4osDc2164guA==} engines: {node: '>=14.0.0'} @@ -2411,7 +2366,6 @@ packages: /tinyspy/0.2.10: resolution: {integrity: sha512-Qij6rGWCDjWIejxCXXVi6bNgvrYBp3PbqC4cBP/0fD6WHDOHCw09Zd13CsxrDqSR5PFq01WeqDws8t5lz5sH0A==} engines: {node: '>=14.0.0'} ->>>>>>> master dev: false /to-regex-range/5.0.1: @@ -2557,8 +2511,8 @@ packages: optionalDependencies: fsevents: 2.3.2 - /vitest/0.3.2: - resolution: {integrity: sha512-Xc0u8BVPBdD029uDcLSYDvy1MFenC6V8WvTJOGdld6NNWgz/swgsMvwZNzftsDohmHLgDyck8A+TaQdDd1tNwA==} + /vitest/0.3.5: + resolution: {integrity: sha512-IIYupM5RAN9H44F5k/Yz0DEORHPJC8qwdi6sQmcdjrxqfxIHypq9PoutQQrW1WKW9O9yUNYG5VGHeHlqAXa9wg==} engines: {node: '>=14.14.0'} hasBin: true peerDependencies: diff --git a/website/homepage/render_html.py b/website/homepage/render_html.py index cd3bedfb09..4032c4a448 100644 --- a/website/homepage/render_html.py +++ b/website/homepage/render_html.py @@ -16,8 +16,13 @@ from gradio.outputs import OutputComponent GRADIO_DIR = "../../" GRADIO_GUIDES_DIR = os.path.join(GRADIO_DIR, "guides") GRADIO_DEMO_DIR = os.path.join(GRADIO_DIR, "demo") -GRADIO_ASSETS_LIST = os.listdir(os.path.join(GRADIO_DIR, "gradio", "templates", "frontend", "assets")) -GRADIO_ASSETS = {f"{asset.split('.')[0]}_{asset.split('.')[-1]}_file": asset for asset in GRADIO_ASSETS_LIST} +GRADIO_ASSETS_LIST = os.listdir( + os.path.join(GRADIO_DIR, "gradio", "templates", "frontend", "assets") +) +GRADIO_ASSETS = { + f"{asset.split('.')[0]}_{asset.split('.')[-1]}_file": asset + for asset in GRADIO_ASSETS_LIST +} with open("src/navbar.html", encoding="utf-8") as navbar_file: navbar_html = navbar_file.read() @@ -36,7 +41,10 @@ def render_index(): with open("src/index_template.html", encoding="utf-8") as template_file: template = Template(template_file.read()) output_html = template.render( - tweets=tweets, star_count=star_count, navbar_html=navbar_html, **GRADIO_ASSETS + tweets=tweets, + star_count=star_count, + navbar_html=navbar_html, + **GRADIO_ASSETS, ) with open( os.path.join("generated", "index.html"), "w", encoding="utf-8" @@ -147,13 +155,19 @@ def render_guides(): guide_output, ) - copy_button = "" - guide_output = guide_output.replace("
", "
")
+        copy_button = (
+            ""
+        )
+        guide_output = guide_output.replace(
+            "
", "
"
+        )
         guide_output = guide_output.replace("
", f"
{copy_button}
") - output_html = markdown2.markdown(guide_output, extras=["target-blank-links", "header-ids"]) + output_html = markdown2.markdown( + guide_output, extras=["target-blank-links", "header-ids"] + ) os.makedirs("generated", exist_ok=True) os.makedirs(os.path.join("generated", guide["name"]), exist_ok=True) with open( @@ -174,7 +188,7 @@ def render_guides(): guide_name=guide["name"], spaces=guide["spaces"], tags=guide["tags"], - **GRADIO_ASSETS + **GRADIO_ASSETS, ) generated_template.write(output_html)