bug fix (return ValueError → raise ValueError) (#2445)

* bug fix (return ValueError → raise ValueError)

* changelog

Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
Vova Zakharov 2022-10-12 22:38:42 +03:00 committed by GitHub
parent 89fc21b17d
commit 72c2ace2b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -28,6 +28,8 @@ No changes to highlight.
* Automatically restart spaces if they're down by [@aliabd](https://github.com/aliabd) in [PR 2405](https://github.com/gradio-app/gradio/pull/2405)
* Carousel component is now deprecated by [@abidlabs](https://github.com/abidlabs) in [PR 2434](https://github.com/gradio-app/gradio/pull/2434)
* Build Gradio from source in ui tests by by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2440](https://github.com/gradio-app/gradio/pull/2440)
* Change "return ValueError" to "raise ValueError" by [@vzakharov](https://github.com/vzakharov) in [PR 2445](https://github.com/gradio-app/gradio/pull/2445)
## Contributors Shoutout:
No changes to highlight.

View File

@ -359,7 +359,7 @@ def convert_component_dict_to_list(outputs_ids: List[int], predictions: Dict) ->
reordered_predictions = [skip() for _ in outputs_ids]
for component, value in predictions.items():
if component._id not in outputs_ids:
return ValueError(
raise ValueError(
f"Returned component {component} not specified as output of function."
)
output_index = outputs_ids.index(component._id)