FPll commited on
Commit
00c684d
Β·
verified Β·
1 Parent(s): ffd2013

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -14
app.py CHANGED
@@ -64,17 +64,15 @@ def respond(message, history):
64
 
65
  # 3. Interfaccia Chat
66
 
67
- # Trucco CSS per scurire i bordi del riquadro di testo senza far crashare Gradio
68
- description_html = """
69
- <style>
70
- /* Forza un bordo scuro e spesso per il riquadro dove si scrive */
71
- textarea {
72
- border: 2px solid #4a4a4a !important;
73
- border-radius: 8px !important;
74
- background-color: #ffffff !important;
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 con Invio rapido
90
  textbox=gr.Textbox(
 
91
  placeholder="πŸ‘‰ Scrivi qui la tua domanda e premi INVIO...",
92
  container=False,
93
  scale=7
94
  ),
95
- # 3. Testi e stile personalizzato
96
  title="πŸš€ Limba 1.0 - Progetto Margherita",
97
- description=description_html,
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)