gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.42k stars 2.53k forks source link

Allow highlighting snippets in the `Code` component #5872

Closed abidlabs closed 8 months ago

abidlabs commented 1 year ago

For code completion models, it would be nice to able to highlight part of the code (for example, the completion by the model -- to distinguish it from the input prompt).

This could be a custom component as well.

Example Space: https://huggingface.co/spaces/mithril-security/starcoder_memorization_checker

abidlabs commented 8 months ago

We now have a custom component that does exactly this: https://huggingface.co/spaces/abidlabs/gradio_highlightedcode