quan1998 commited on
Commit
67655f4
·
verified ·
1 Parent(s): b9c3c31

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
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
- print(prompt)
8
- image = client.text_to_image(prompt)
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