Spaces:
Running
Running
Commit
·
5f54907
1
Parent(s):
91ad1e7
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,7 +12,7 @@ def getTextTrans(text, source='zh', target='en'):
|
|
| 12 |
return True
|
| 13 |
return False
|
| 14 |
|
| 15 |
-
if not is_chinese(text):
|
| 16 |
return text
|
| 17 |
|
| 18 |
try:
|
|
@@ -132,7 +132,7 @@ start_work = """async() => {
|
|
| 132 |
window['doCheckPrompt'] = 0;
|
| 133 |
window['checkPrompt'] = function checkPrompt() {
|
| 134 |
try {
|
| 135 |
-
text_value = window['gradioEl'].querySelectorAll('#prompt_work')[0].querySelectorAll('textarea')[0].value
|
| 136 |
progress_bar = window['gradioEl'].querySelectorAll('.progress-bar');
|
| 137 |
if (window['doCheckPrompt'] === 0 && window['prevPrompt'] !== text_value && progress_bar.length == 0) {
|
| 138 |
console.log('_____new prompt___[' + text_value + ']_');
|
|
|
|
| 12 |
return True
|
| 13 |
return False
|
| 14 |
|
| 15 |
+
if not is_chinese(text) and target == 'en':
|
| 16 |
return text
|
| 17 |
|
| 18 |
try:
|
|
|
|
| 132 |
window['doCheckPrompt'] = 0;
|
| 133 |
window['checkPrompt'] = function checkPrompt() {
|
| 134 |
try {
|
| 135 |
+
text_value = window['gradioEl'].querySelectorAll('#prompt_work')[0].querySelectorAll('textarea')[0].value;
|
| 136 |
progress_bar = window['gradioEl'].querySelectorAll('.progress-bar');
|
| 137 |
if (window['doCheckPrompt'] === 0 && window['prevPrompt'] !== text_value && progress_bar.length == 0) {
|
| 138 |
console.log('_____new prompt___[' + text_value + ']_');
|