Rooni commited on
Commit
5b51878
1 Parent(s): c60777d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -3,6 +3,8 @@ import os
3
  from gradio_client import Client
4
  import time
5
  import requests
 
 
6
 
7
 
8
  MORE = """ ## TRY Other Models
@@ -15,6 +17,12 @@ client = Client("KingNish/Instant-Video")
15
 
16
  # Function
17
  def generate_image(prompt, base="Anime", motion="", step=8, progress=gr.Progress()):
 
 
 
 
 
 
18
  try:
19
  result = client.predict(
20
  prompt=prompt,
 
3
  from gradio_client import Client
4
  import time
5
  import requests
6
+ from deep_translator import GoogleTranslator
7
+ from langdetect import detect
8
 
9
 
10
  MORE = """ ## TRY Other Models
 
17
 
18
  # Function
19
  def generate_image(prompt, base="Anime", motion="", step=8, progress=gr.Progress()):
20
+
21
+ language = detect(prompt)
22
+
23
+ if language != 'en':
24
+ prompt = GoogleTranslator(source=language, target='en').translate(prompt)
25
+
26
  try:
27
  result = client.predict(
28
  prompt=prompt,