Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,15 @@ from huggingface_hub import InferenceClient
|
|
3 |
|
4 |
client = InferenceClient("stabilityai/stable-diffusion-xl-base-1.0")
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def greet(prompt):
|
7 |
-
|
8 |
-
image = client.text_to_image(
|
9 |
print(image)
|
10 |
return image
|
11 |
|
|
|
3 |
|
4 |
client = InferenceClient("stabilityai/stable-diffusion-xl-base-1.0")
|
5 |
|
6 |
+
clientTranslate = InferenceClient("Helsinki-NLP/opus-mt-vi-en")
|
7 |
+
|
8 |
+
def translate(text):
|
9 |
+
res = clientTranslate.translation(text)
|
10 |
+
return res.translation_text
|
11 |
+
|
12 |
def greet(prompt):
|
13 |
+
text = translate(prompt)
|
14 |
+
image = client.text_to_image(text)
|
15 |
print(image)
|
16 |
return image
|
17 |
|