Spaces:
Runtime error
Runtime error
Commit
·
24cead7
1
Parent(s):
3efdcac
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,7 +167,9 @@ def real_img2img_to_anime(text, input_img, chinese_check):
|
|
| 167 |
input_img = Image.fromarray(input_img)
|
| 168 |
input_img = load_image(input_img)
|
| 169 |
compel_proc = Compel(tokenizer=pipe_scribble.tokenizer, text_encoder=pipe_scribble.text_encoder)
|
| 170 |
-
|
|
|
|
|
|
|
| 171 |
text = translate(text)
|
| 172 |
print("prompt text:", text)
|
| 173 |
prompt = text + hidden_booster_text
|
|
|
|
| 167 |
input_img = Image.fromarray(input_img)
|
| 168 |
input_img = load_image(input_img)
|
| 169 |
compel_proc = Compel(tokenizer=pipe_scribble.tokenizer, text_encoder=pipe_scribble.text_encoder)
|
| 170 |
+
lang_check_label = pipe(text, top_k=1, truncation=True)[0]['label']
|
| 171 |
+
lang_check_score = pipe(text, top_k=1, truncation=True)[0]['score']
|
| 172 |
+
if lang_check_label == 'zh' and lang_check_score >= 0.85:
|
| 173 |
text = translate(text)
|
| 174 |
print("prompt text:", text)
|
| 175 |
prompt = text + hidden_booster_text
|