MPS (Apple SIlicon) Support + fix: ensure HighlightedText receives a valid payload (avoid IndexError) #76
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MPS (Apple Silicon) support and fixed bugs re multinomial sampling across demos and the Gradio app
Shared device/dtype selection
select_device()+ backend→dtype map:torch.bfloat16torch.float16torch.float32Guarded multinomial sampling
torch.multinomialNaN/Infwith00Accepts tensors of arbitrary rank, flattens to 2D for sampling to satisfy PyTorch’s 1–2D constraint, Reshapes sampled indices back to the original shape
Fixes a runtime crash in the Gradio UI caused by
HighlightedTextexpecting list-of-tuples but getting a stringhighlight_message()helper to wrap error/status strings as a HighlightedText-compatible list of (text, color) tuples.dream_generate_with_visualizationerror paths withhighlight_message(error_message)sogr.HighlightedTextno longer throwsIndexError.vis_output_display(instead of "") so the HighlightedText component always receives a consistent type.[]for skip response inbot_response_generatorto maintain consistent component behavior.