Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,8 +15,11 @@ 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 |
# Dark mode toggle
|
| 19 |
-
dark_mode = st.sidebar.checkbox("Dark Mode")
|
| 20 |
|
| 21 |
# Custom CSS for dark and light mode
|
| 22 |
if dark_mode:
|
|
@@ -24,19 +27,29 @@ if dark_mode:
|
|
| 24 |
"""
|
| 25 |
<style>
|
| 26 |
body {
|
| 27 |
-
background-color: #
|
| 28 |
color: #FFFFFF;
|
| 29 |
}
|
| 30 |
.stButton>button {
|
| 31 |
-
background-color: #
|
| 32 |
color: white;
|
| 33 |
}
|
| 34 |
.stTextInput>div>input {
|
| 35 |
-
background-color: #
|
| 36 |
color: white;
|
|
|
|
| 37 |
}
|
| 38 |
.stSidebar {
|
| 39 |
-
background-color: #
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
}
|
| 41 |
</style>
|
| 42 |
""",
|
|
@@ -57,10 +70,20 @@ else:
|
|
| 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,
|
|
@@ -70,7 +93,6 @@ else:
|
|
| 70 |
input_text = st.text_area("Enter English text:", value="")
|
| 71 |
|
| 72 |
# Sidebar for language selection
|
| 73 |
-
st.sidebar.title("Settings")
|
| 74 |
st.sidebar.subheader("Select Target Language")
|
| 75 |
|
| 76 |
language_options = {
|
|
@@ -109,7 +131,7 @@ if st.button("Translate"):
|
|
| 109 |
st.write("Please enter text to translate.")
|
| 110 |
|
| 111 |
# Contact information
|
| 112 |
-
st.sidebar.
|
| 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 |
|
|
|
|
| 15 |
st.title("English to Multiple Language Translator")
|
| 16 |
st.write("Translate English text into different languages using AI.")
|
| 17 |
|
| 18 |
+
# Sidebar for settings
|
| 19 |
+
st.sidebar.title("Settings")
|
| 20 |
+
|
| 21 |
# Dark mode toggle
|
| 22 |
+
dark_mode = st.sidebar.checkbox("🌙 Dark Mode")
|
| 23 |
|
| 24 |
# Custom CSS for dark and light mode
|
| 25 |
if dark_mode:
|
|
|
|
| 27 |
"""
|
| 28 |
<style>
|
| 29 |
body {
|
| 30 |
+
background-color: #2e2e2e;
|
| 31 |
color: #FFFFFF;
|
| 32 |
}
|
| 33 |
.stButton>button {
|
| 34 |
+
background-color: #4CAF50;
|
| 35 |
color: white;
|
| 36 |
}
|
| 37 |
.stTextInput>div>input {
|
| 38 |
+
background-color: #4b4b4b;
|
| 39 |
color: white;
|
| 40 |
+
border: 1px solid #ccc;
|
| 41 |
}
|
| 42 |
.stSidebar {
|
| 43 |
+
background-color: #383838;
|
| 44 |
+
}
|
| 45 |
+
.stSidebar h1, .stSidebar h2, .stSidebar h3, .stSidebar h4, .stSidebar h5, .stSidebar h6, .stSidebar .markdown-text-container {
|
| 46 |
+
color: #FFFFFF;
|
| 47 |
+
}
|
| 48 |
+
.stSidebar a {
|
| 49 |
+
color: #1f77b4;
|
| 50 |
+
}
|
| 51 |
+
.stSidebar .stCheckbox div {
|
| 52 |
+
color: #FFFFFF;
|
| 53 |
}
|
| 54 |
</style>
|
| 55 |
""",
|
|
|
|
| 70 |
.stTextInput>div>input {
|
| 71 |
background-color: #FFFFFF;
|
| 72 |
color: black;
|
| 73 |
+
border: 1px solid #ccc;
|
| 74 |
}
|
| 75 |
.stSidebar {
|
| 76 |
background-color: #f0f2f6;
|
| 77 |
}
|
| 78 |
+
.stSidebar h1, .stSidebar h2, .stSidebar h3, .stSidebar h4, .stSidebar h5, .stSidebar h6, .stSidebar .markdown-text-container {
|
| 79 |
+
color: #000000;
|
| 80 |
+
}
|
| 81 |
+
.stSidebar a {
|
| 82 |
+
color: #1f77b4;
|
| 83 |
+
}
|
| 84 |
+
.stSidebar .stCheckbox div {
|
| 85 |
+
color: #000000;
|
| 86 |
+
}
|
| 87 |
</style>
|
| 88 |
""",
|
| 89 |
unsafe_allow_html=True,
|
|
|
|
| 93 |
input_text = st.text_area("Enter English text:", value="")
|
| 94 |
|
| 95 |
# Sidebar for language selection
|
|
|
|
| 96 |
st.sidebar.subheader("Select Target Language")
|
| 97 |
|
| 98 |
language_options = {
|
|
|
|
| 131 |
st.write("Please enter text to translate.")
|
| 132 |
|
| 133 |
# Contact information
|
| 134 |
+
st.sidebar.subheader("Contact Developer")
|
| 135 |
st.sidebar.write("Developer: [M.Abbas](https://www.linkedin.com/in/mohammad-abbas-dev/)")
|
| 136 |
st.sidebar.write("Gmail: Abbas.mohammad805@gmail.com")
|
| 137 |
|