MANIKANDAN A
commited on
Commit
·
882b3ea
1
Parent(s):
382c141
Update app.py
Browse files
app.py
CHANGED
@@ -18,9 +18,7 @@ def get_model():
|
|
18 |
|
19 |
caption_model = get_model()
|
20 |
|
21 |
-
|
22 |
-
translated = translator.translate(caption, dest=target_language)
|
23 |
-
return translated.text
|
24 |
|
25 |
# Constants
|
26 |
SIGNUP_SUCCESS_MSG = "Signup successful! You can now login."
|
@@ -103,7 +101,10 @@ def login_section():
|
|
103 |
st.error(f"An error occurred while trying to log in: {e}")
|
104 |
|
105 |
|
106 |
-
|
|
|
|
|
|
|
107 |
def predict(cap_col):
|
108 |
captions = []
|
109 |
pred_caption = generate_caption('tmp.jpg', caption_model)
|
|
|
18 |
|
19 |
caption_model = get_model()
|
20 |
|
21 |
+
|
|
|
|
|
22 |
|
23 |
# Constants
|
24 |
SIGNUP_SUCCESS_MSG = "Signup successful! You can now login."
|
|
|
101 |
st.error(f"An error occurred while trying to log in: {e}")
|
102 |
|
103 |
|
104 |
+
def translate_caption(caption, target_language='en'):
|
105 |
+
translated = translator.translate(caption, dest=target_language)
|
106 |
+
return translated.text
|
107 |
+
|
108 |
def predict(cap_col):
|
109 |
captions = []
|
110 |
pred_caption = generate_caption('tmp.jpg', caption_model)
|