Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,17 +64,15 @@ def respond(message, history):
|
|
| 64 |
|
| 65 |
# 3. Interfaccia Chat
|
| 66 |
|
| 67 |
-
#
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
</style>
|
| 77 |
-
Liceo Scientifico 'E. Fermi' - Nuoro. Assistente creato da Francesco Palladino.
|
| 78 |
"""
|
| 79 |
|
| 80 |
demo = gr.ChatInterface(
|
|
@@ -86,15 +84,16 @@ demo = gr.ChatInterface(
|
|
| 86 |
{"left": "$", "right": "$", "display": False}
|
| 87 |
]
|
| 88 |
),
|
| 89 |
-
# 2. Riquadro di testo
|
| 90 |
textbox=gr.Textbox(
|
|
|
|
| 91 |
placeholder="π Scrivi qui la tua domanda e premi INVIO...",
|
| 92 |
container=False,
|
| 93 |
scale=7
|
| 94 |
),
|
| 95 |
-
#
|
| 96 |
title="π Limba 1.0 - Progetto Margherita",
|
| 97 |
-
description=
|
| 98 |
examples=[
|
| 99 |
"Chie ti hat creadu?",
|
| 100 |
"Spiegami la seconda legge di Newton",
|
|
@@ -111,5 +110,8 @@ if __name__ == "__main__":
|
|
| 111 |
if __name__ == "__main__":
|
| 112 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 113 |
|
|
|
|
|
|
|
|
|
|
| 114 |
if __name__ == "__main__":
|
| 115 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
| 64 |
|
| 65 |
# 3. Interfaccia Chat
|
| 66 |
|
| 67 |
+
# Definiamo il CSS ufficiale puntando all'ID del nostro riquadro
|
| 68 |
+
custom_css = """
|
| 69 |
+
#bordo-scuro {
|
| 70 |
+
border: 3px solid #000000 !important;
|
| 71 |
+
border-radius: 8px !important;
|
| 72 |
+
}
|
| 73 |
+
#bordo-scuro textarea {
|
| 74 |
+
background-color: #ffffff !important;
|
| 75 |
+
}
|
|
|
|
|
|
|
| 76 |
"""
|
| 77 |
|
| 78 |
demo = gr.ChatInterface(
|
|
|
|
| 84 |
{"left": "$", "right": "$", "display": False}
|
| 85 |
]
|
| 86 |
),
|
| 87 |
+
# 2. Riquadro di testo collegato al nostro CSS tramite elem_id
|
| 88 |
textbox=gr.Textbox(
|
| 89 |
+
elem_id="bordo-scuro", # <--- Questo collega il box al CSS
|
| 90 |
placeholder="π Scrivi qui la tua domanda e premi INVIO...",
|
| 91 |
container=False,
|
| 92 |
scale=7
|
| 93 |
),
|
| 94 |
+
css=custom_css, # <--- Inseriamo il blocco grafico qui
|
| 95 |
title="π Limba 1.0 - Progetto Margherita",
|
| 96 |
+
description="Assistente creato dagli studenti del Liceo Scientifico 'E. Fermi' - Nuoro e dal docente di intelligenza artificiale Francesco Palladino.",
|
| 97 |
examples=[
|
| 98 |
"Chie ti hat creadu?",
|
| 99 |
"Spiegami la seconda legge di Newton",
|
|
|
|
| 110 |
if __name__ == "__main__":
|
| 111 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 112 |
|
| 113 |
+
if __name__ == "__main__":
|
| 114 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
| 115 |
+
|
| 116 |
if __name__ == "__main__":
|
| 117 |
demo.launch(server_name="0.0.0.0", server_port=7860)
|