Skip to content

Commit

Permalink
Fixes issue with indentation in code field with streaming (#4043)
Browse files Browse the repository at this point in the history
* indent fix

* fix

* changelog

* fix overflowing gutter and dark mode base color (#4051)

* Add ability to blocklist filepaths, ability to specify where gradio temp files are created (#4047)

* temporary file

* tests

* formatting

* rename

* added another test

* guide

* formatting

* changelog

* added custom gradio temp directory (#4053)

* added custom gradio temp directory

* Update 03_sharing-your-app.md

* rename test

* address review

* remove print

* Chatbot code syntax highlighting (#4048)

* first pass

* fixes

* more fixes

* remove breaks

* format

* version

* pr fixes

* changelog

* test fix

* background color

* format

* revert test fix

* changes

* changes

* test

* changes

* changes

* changes

* changes

* changes

---------

Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: Ali Abid <[email protected]>

* fix

* fix test

---------

Co-authored-by: Abubakar Abid <[email protected]>
Co-authored-by: pngwn <[email protected]>
Co-authored-by: Ali Abid <[email protected]>
  • Loading branch information
4 people committed Jun 2, 2023
1 parent b89061b commit f8d915f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
9 changes: 3 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
# Upcoming Release

## Bug Fixes

- Code component visual updates by [@pngwn](https://github.com/pngwn) in [PR 4051](https://github.com/gradio-app/gradio/pull/4051)

## New Features:

- Min and max value for gr.Number by [@artegoser](https://github.com/artegoser) and [@dawoodkhan82] (https://github.com/dawoodkhan82) in [PR 3991](https://github.com/gradio-app/gradio/pull/3991)
Expand All @@ -15,8 +11,9 @@
## Bug Fixes:

- Fixes issue with `matplotlib` not rendering correctly if the backend was not set to `Agg` by [@abidlabs](https://github.com/abidlabs) in [PR 4029](https://github.com/gradio-app/gradio/pull/4029)
- Fixes bug where rendering the same `gr.State` across different Interfaces/Blocks within
a larger Blocks would not work by [@abidlabs](https://github.com/abidlabs) in [PR 4030](https://github.com/gradio-app/gradio/pull/4030)
- Fixes bug where rendering the same `gr.State` across different Interfaces/Blocks within larger Blocks would not work by [@abidlabs](https://github.com/abidlabs) in [PR 4030](https://github.com/gradio-app/gradio/pull/4030)
- Fixes issue with indentation in `gr.Code()` component with streaming by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 4043](https://github.com/gradio-app/gradio/pull/4043)
- Code component visual updates by [@pngwn](https://github.com/pngwn) in [PR 4051](https://github.com/gradio-app/gradio/pull/4051)

## Documentation Changes:

Expand Down
3 changes: 1 addition & 2 deletions gradio/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -6092,8 +6092,7 @@ def postprocess(self, y):
with open(y[0]) as file_data:
return file_data.read()
else:
unindented_y = inspect.cleandoc(y)
return unindented_y
return y.strip()

@staticmethod
def update(
Expand Down
3 changes: 2 additions & 1 deletion test/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,8 @@ def fn(a):
return a
"""
)
== "def fn(a):\n return a"
== """def fn(a):
return a"""
)

test_file_dir = Path(Path(__file__).parent, "test_files")
Expand Down

0 comments on commit f8d915f

Please sign in to comment.