[GH-ISSUE #4] feat: language translation layer #8

Closed
opened 2026-10-18 21:01:26 +00:00 by bsakaguchi · 9 comments
Owner

Originally created by @rvsh2 on GitHub (Mar 31, 2024).
Original GitHub issue: https://github.com/open-webui/pipelines/issues/4

Is your feature request related to a problem? Please describe.
The problem with many models is that they are good only in english language.

Describe the solution you'd like
There could be additional layers for translation:
INPUT: Translation model from any language to English
MIDDLE: Intent model (eg. ChatGpt, ollama models)
OUTPUT: Translation model from English to any language
This would be groundbreaking functionality because many models have trouble with other languages than english.

For example this model could be used for translation:
https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt

Describe alternatives you've considered
No alternatives for now.

Additional context
Add any other context or screenshots about the feature request here.

Originally created by @rvsh2 on GitHub (Mar 31, 2024). Original GitHub issue: https://github.com/open-webui/pipelines/issues/4 **Is your feature request related to a problem? Please describe.** The problem with many models is that they are good only in english language. **Describe the solution you'd like** There could be additional layers for translation: INPUT: Translation model from any language to English MIDDLE: Intent model (eg. ChatGpt, ollama models) OUTPUT: Translation model from English to any language This would be groundbreaking functionality because many models have trouble with other languages than english. For example this model could be used for translation: https://huggingface.co/facebook/mbart-large-50-many-to-many-mmt **Describe alternatives you've considered** No alternatives for now. **Additional context** Add any other context or screenshots about the feature request here.
Author
Owner

@tcztzy commented on GitHub (May 24, 2024):

This is some kind like a middleware in fastapi/django

<!-- gh-comment-id:2129118525 --> @tcztzy commented on GitHub (May 24, 2024): This is some kind like a `middleware` in `fastapi`/`django`
Author
Owner

@tjbck commented on GitHub (May 28, 2024):

@tcztzy pipeline filter type has been added to exactly allow this. Compatible with Open WebUI latest dev!

image

workflow

<!-- gh-comment-id:2136061811 --> @tjbck commented on GitHub (May 28, 2024): @tcztzy pipeline `filter` type has been added to exactly allow this. Compatible with Open WebUI latest dev! ![image](https://github.com/open-webui/pipelines/assets/25473318/ea350579-9813-4b9c-b85d-bc7c73b7ecf2) ![workflow](https://github.com/open-webui/pipelines/assets/25473318/3b8424fe-d6d4-4111-805b-8c50e9164c0b)
Author
Owner
<!-- gh-comment-id:2139171507 --> @tjbck commented on GitHub (May 30, 2024): Implemented with `filter` pipeline using `inlet`, and `outlet` hooks! https://github.com/open-webui/pipelines/assets/25473318/4f818d72-adca-4ed0-a2e7-c5d061236f2d https://github.com/open-webui/pipelines/blob/main/pipelines/examples/libretranlsate_filter_pipeline.py
Author
Owner

@rvsh2 commented on GitHub (May 30, 2024):

That's look amazing - will test it right away :)

<!-- gh-comment-id:2139394447 --> @rvsh2 commented on GitHub (May 30, 2024): That's look amazing - will test it right away :)
Author
Owner

@rvsh2 commented on GitHub (May 30, 2024):

I've installed libretranslate - working fine.
I made a docker for pipelines - working fine on port 9099.
image

image

But I don't have pipelines in Admin settings.
image

Open webui Version seems to be the latest - v0.1.125 (latest)
How to activate pipelines options in open webui?

P.S. if someone need a dockerfile for pipelines I've attached one.
pipelines-docker.zip

<!-- gh-comment-id:2139912027 --> @rvsh2 commented on GitHub (May 30, 2024): I've installed libretranslate - working fine. I made a docker for pipelines - working fine on port 9099. <img width="566" alt="image" src="https://github.com/open-webui/pipelines/assets/32043169/663f98df-1e66-444a-a4a4-0d340f9fde6d"> <img width="641" alt="image" src="https://github.com/open-webui/pipelines/assets/32043169/30defa16-558c-4de7-a8da-143f2c383235"> But I don't have pipelines in Admin settings. <img width="563" alt="image" src="https://github.com/open-webui/pipelines/assets/32043169/1adf949a-05ef-4e2b-bfd8-08dbaab8d4c6"> Open webui Version seems to be the latest - v0.1.125 (latest) How to activate pipelines options in open webui? P.S. if someone need a dockerfile for pipelines I've attached one. [pipelines-docker.zip](https://github.com/open-webui/pipelines/files/15502304/pipelines-docker.zip)
Author
Owner

@justinh-rahb commented on GitHub (May 30, 2024):

@rvsh2 Pipelines support in the UI is only in dev branch right now, pull the dev Docker image tag.

<!-- gh-comment-id:2139923224 --> @justinh-rahb commented on GitHub (May 30, 2024): @rvsh2 Pipelines support in the UI is only in `dev` branch right now, pull the `dev` Docker image tag.
Author
Owner

@rvsh2 commented on GitHub (May 30, 2024):

OK, I managed it to work. It looks very nice. I will try to test it more.

<!-- gh-comment-id:2140030261 --> @rvsh2 commented on GitHub (May 30, 2024): OK, I managed it to work. It looks very nice. I will try to test it more.
Author
Owner

@rvsh2 commented on GitHub (May 30, 2024):

Ok It works very good. No bugs :) but I'm thinking about the concept and do you think there is a possiblity that libretranslate will only translate relevant information for example:
let's ask llama3: Write a simple python script that counts from 1 to 100 (no more than 4 sentences)

USER: Napisz prosty skrypt w python liczacy od 1 do 100 (nie więcej niż 4 zdania(
ASSISTANT WITH TRANSLATED OUTPUT TO POLISH: 
llama3:latest 6:00 PM
Oto prosty skrypt Pythona, który liczy się od 1 do 100:
"'
dla i w zakresie (1, 101):
druk (i)
"'

I don't know libre translate well, for example can it decide to not translate code section somehow?

<!-- gh-comment-id:2140086035 --> @rvsh2 commented on GitHub (May 30, 2024): Ok It works very good. No bugs :) but I'm thinking about the concept and do you think there is a possiblity that libretranslate will only translate relevant information for example: let's ask llama3: **Write a simple python script that counts from 1 to 100 (no more than 4 sentences)** ``` USER: Napisz prosty skrypt w python liczacy od 1 do 100 (nie więcej niż 4 zdania( ASSISTANT WITH TRANSLATED OUTPUT TO POLISH: llama3:latest 6:00 PM Oto prosty skrypt Pythona, który liczy się od 1 do 100: "' dla i w zakresie (1, 101): druk (i) "' ``` I don't know libre translate well, for example can it decide to not translate code section somehow?
Author
Owner

@tjbck commented on GitHub (May 30, 2024):

Related: https://github.com/open-webui/open-webui/issues/2152

Should be relatively easy, PR welcome!

<!-- gh-comment-id:2140443049 --> @tjbck commented on GitHub (May 30, 2024): Related: https://github.com/open-webui/open-webui/issues/2152 Should be relatively easy, PR welcome!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/pipelines#8
No description provided.