Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,6 +15,57 @@ model, tokenizer = load_model_and_tokenizer()
|
|
| 15 |
st.title("English to Multiple Language Translator")
|
| 16 |
st.write("Translate English text into different languages using AI.")
|
| 17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# Input text
|
| 19 |
input_text = st.text_area("Enter English text:", value="")
|
| 20 |
|
|
@@ -58,9 +109,8 @@ if st.button("Translate"):
|
|
| 58 |
st.write("Please enter text to translate.")
|
| 59 |
|
| 60 |
# Contact information
|
| 61 |
-
st.sidebar.title("Contact
|
| 62 |
-
st.sidebar.write("Developer: M.Abbas")
|
| 63 |
-
st.sidebar.write("[LinkedIn](https://www.linkedin.com/in/mohammad-abbas-dev/)")
|
| 64 |
st.sidebar.write("Gmail: Abbas.mohammad805@gmail.com")
|
| 65 |
|
| 66 |
# WhatsApp bot contact
|
|
|
|
| 15 |
st.title("English to Multiple Language Translator")
|
| 16 |
st.write("Translate English text into different languages using AI.")
|
| 17 |
|
| 18 |
+
# Dark mode toggle
|
| 19 |
+
dark_mode = st.sidebar.checkbox("Dark Mode")
|
| 20 |
+
|
| 21 |
+
# Custom CSS for dark and light mode
|
| 22 |
+
if dark_mode:
|
| 23 |
+
st.markdown(
|
| 24 |
+
"""
|
| 25 |
+
<style>
|
| 26 |
+
body {
|
| 27 |
+
background-color: #121212;
|
| 28 |
+
color: #FFFFFF;
|
| 29 |
+
}
|
| 30 |
+
.stButton>button {
|
| 31 |
+
background-color: #1f77b4;
|
| 32 |
+
color: white;
|
| 33 |
+
}
|
| 34 |
+
.stTextInput>div>input {
|
| 35 |
+
background-color: #333333;
|
| 36 |
+
color: white;
|
| 37 |
+
}
|
| 38 |
+
.stSidebar {
|
| 39 |
+
background-color: #333333;
|
| 40 |
+
}
|
| 41 |
+
</style>
|
| 42 |
+
""",
|
| 43 |
+
unsafe_allow_html=True,
|
| 44 |
+
)
|
| 45 |
+
else:
|
| 46 |
+
st.markdown(
|
| 47 |
+
"""
|
| 48 |
+
<style>
|
| 49 |
+
body {
|
| 50 |
+
background-color: #FFFFFF;
|
| 51 |
+
color: #000000;
|
| 52 |
+
}
|
| 53 |
+
.stButton>button {
|
| 54 |
+
background-color: #1f77b4;
|
| 55 |
+
color: white;
|
| 56 |
+
}
|
| 57 |
+
.stTextInput>div>input {
|
| 58 |
+
background-color: #FFFFFF;
|
| 59 |
+
color: black;
|
| 60 |
+
}
|
| 61 |
+
.stSidebar {
|
| 62 |
+
background-color: #f0f2f6;
|
| 63 |
+
}
|
| 64 |
+
</style>
|
| 65 |
+
""",
|
| 66 |
+
unsafe_allow_html=True,
|
| 67 |
+
)
|
| 68 |
+
|
| 69 |
# Input text
|
| 70 |
input_text = st.text_area("Enter English text:", value="")
|
| 71 |
|
|
|
|
| 109 |
st.write("Please enter text to translate.")
|
| 110 |
|
| 111 |
# Contact information
|
| 112 |
+
st.sidebar.title("Contact Us")
|
| 113 |
+
st.sidebar.write("Developer: [M.Abbas](https://www.linkedin.com/in/mohammad-abbas-dev/)")
|
|
|
|
| 114 |
st.sidebar.write("Gmail: Abbas.mohammad805@gmail.com")
|
| 115 |
|
| 116 |
# WhatsApp bot contact
|