Roseco-crs
commited on
Commit
·
592c318
1
Parent(s):
306b3d4
Remove the gradio footer by injecting a CSS code.
Browse files
app.py
CHANGED
|
@@ -2,18 +2,35 @@ from ailab_crs import NLP_tasks_crs, Prompt_engineering_crs
|
|
| 2 |
import gradio as gr
|
| 3 |
from googletrans import LANGUAGES
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
nlp_tasks = NLP_tasks_crs()
|
| 7 |
supported_langs = list(LANGUAGES.values())
|
| 8 |
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
gr.Markdown("# 🧠 NaanhAI 💡")
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
| 12 |
with gr.Row():
|
| 13 |
with gr.Column():
|
| 14 |
text = gr.Textbox(label="Your Query", lines=8)
|
| 15 |
with gr.Column():
|
| 16 |
-
with gr.Accordion("Translation & Summarization Parameters
|
| 17 |
language = gr.Dropdown(choices=supported_langs, label="Select Target Language", value="french")
|
| 18 |
style = gr.Textbox(label="Choose Your Style", value="polite")
|
| 19 |
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from googletrans import LANGUAGES
|
| 4 |
|
| 5 |
+
# CSS to hide the entire footer, including "Made with Gradio", settings, and API info
|
| 6 |
+
hide_footer_css = """
|
| 7 |
+
<style>
|
| 8 |
+
footer, footer * {
|
| 9 |
+
display: none !important;
|
| 10 |
+
}
|
| 11 |
+
</style>
|
| 12 |
+
"""
|
| 13 |
|
| 14 |
nlp_tasks = NLP_tasks_crs()
|
| 15 |
supported_langs = list(LANGUAGES.values())
|
| 16 |
|
| 17 |
+
def hide_footer():
|
| 18 |
+
return """
|
| 19 |
+
footer {visibility: hidden;}
|
| 20 |
+
#footer {display: none !important;}
|
| 21 |
+
"""
|
| 22 |
+
|
| 23 |
+
with gr.Blocks() as demo:
|
| 24 |
gr.Markdown("# 🧠 NaanhAI 💡")
|
| 25 |
+
|
| 26 |
+
# Inject the CSS at the top
|
| 27 |
+
gr.HTML(hide_footer_css)
|
| 28 |
+
|
| 29 |
with gr.Row():
|
| 30 |
with gr.Column():
|
| 31 |
text = gr.Textbox(label="Your Query", lines=8)
|
| 32 |
with gr.Column():
|
| 33 |
+
with gr.Accordion("Translation & Summarization Parameters ", open= True):
|
| 34 |
language = gr.Dropdown(choices=supported_langs, label="Select Target Language", value="french")
|
| 35 |
style = gr.Textbox(label="Choose Your Style", value="polite")
|
| 36 |
|