Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llama-server: Support for RTL text as models input or output #11208

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

ebraminio
Copy link
Contributor

@ebraminio ebraminio commented Jan 12, 2025

This is least intrusive and most lightweight way to support RTL text as input text or output result of llama-server.

Use of dir="auto" in multi language websites is common, markdown result of GitHub even uses dir="auto",

image

To test this, try the following prompt:

گزارهٔ «بودن، یا نبودن» اثر کیست و به چه معنی است؟

The patch touches three parts of the UI and turns this

image

to this

image

@ngxson
Copy link
Collaborator

ngxson commented Jan 13, 2025

IIRC, in RTL languages, other elements are swapped to? (i.e. the send button on the left, chat bubbles are also reversed)

Just saying that, not urgent to do it now, but maybe we can support in the future (wondering if daisyui already had support for this)

@ngxson ngxson merged commit 437e05f into ggerganov:master Jan 13, 2025
6 checks passed
@ebraminio
Copy link
Contributor Author

ebraminio commented Jan 13, 2025

Thank you so much for the merge first of all.

IIRC, in RTL languages, other elements are swapped to? (i.e. the send button on the left, chat bubbles are also reversed)

As we don't actually want to translate the UI this isn't needed here. To have an already established mental model, consider some software can have two languages, one that is used for the content and one that is used for the UI, for example you can visit English Wikipedia (with English content) in Persian UI https://en.wikipedia.org/?uselang=fa (compare the sidebar position with https://en.wikipedia.org/ ) and visit Persian Wikipedia in English UI https://fa.wikipedia.org/?uselang=en the idea here was to make content and conversation compatible with RTL text but maybe in future if it could make sense to actually translate the UI also things like changing the UI direction can make sense, and even then, the solution here is useful when someone wants to have an English conversation but in Persian UI.

Thanks again 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants