mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-24 00:46:53 +01:00
Fix Google Translate escaping (#3827)
--------- Co-authored-by: oobabooga <112222186+oobabooga@users.noreply.github.com>
This commit is contained in:
parent
7c9664ed35
commit
cd534ba46e
@ -1,3 +1,5 @@
|
||||
import html
|
||||
|
||||
import gradio as gr
|
||||
from deep_translator import GoogleTranslator
|
||||
|
||||
@ -27,7 +29,8 @@ def output_modifier(string):
|
||||
if not params['activate']:
|
||||
return string
|
||||
|
||||
return GoogleTranslator(source='en', target=params['language string']).translate(string)
|
||||
translated_str = GoogleTranslator(source='en', target=params['language string']).translate(html.unescape(string))
|
||||
return html.escape(translated_str)
|
||||
|
||||
|
||||
def bot_prefix_modifier(string):
|
||||
|
Loading…
Reference in New Issue
Block a user