Light-Dav commited on
Commit
5cabd66
verified
1 Parent(s): 7e669a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -8
app.py CHANGED
@@ -9,8 +9,6 @@ print(f"Gradio version at runtime: {gr.__version__}")
9
  MODEL_ID = "Light-Dav/sentiment-analysis-full-project"
10
 
11
  try:
12
- # Esto carga tu modelo pre-entrenado desde Hugging Face Hub
13
- # top_k=None asegura que se devuelvan las puntuaciones de todas las clases (positivo, negativo, neutral)
14
  sentiment_analyzer = pipeline("sentiment-analysis", model=MODEL_ID, top_k=None)
15
  model_loaded_successfully = True
16
  print("Sentiment analysis model loaded successfully.")
@@ -169,11 +167,8 @@ p {
169
  background-color: #007ACC !important; /* Azul Oscuro al pasar el rat贸n por los ejemplos */
170
  border-color: #00BFFF !important;
171
  }
172
- .example-buttons-row {
173
- flex-wrap: wrap; /* Permitir que los botones se envuelvan si no hay suficiente ancho */
174
- justify-content: center; /* Centrar los botones de ejemplo */
175
- margin-bottom: 5px !important; /* Reducir margen inferior */
176
- }
177
 
178
 
179
  /* L脥NEAS DIVISORIAS */
@@ -301,7 +296,7 @@ with gr.Blocks(css=custom_css, theme=None) as demo:
301
  fn=analyze_sentiment,
302
  outputs=[gr.HTML(label="Sentiment"), gr.Label(num_top_classes=3, label="Scores"), gr.JSON(label="Raw Output", visible=False)], # Labels de salida m谩s cortos
303
  cache_examples=False,
304
- elem_classes="example-buttons-row"
305
  )
306
 
307
  gr.Markdown("<hr>")
 
9
  MODEL_ID = "Light-Dav/sentiment-analysis-full-project"
10
 
11
  try:
 
 
12
  sentiment_analyzer = pipeline("sentiment-analysis", model=MODEL_ID, top_k=None)
13
  model_loaded_successfully = True
14
  print("Sentiment analysis model loaded successfully.")
 
167
  background-color: #007ACC !important; /* Azul Oscuro al pasar el rat贸n por los ejemplos */
168
  border-color: #00BFFF !important;
169
  }
170
+ /* No necesitamos .example-buttons-row en el CSS porque elem_classes no se usa.
171
+ El `gr.Row` ya hace que los ejemplos fluyan horizontalmente. */
 
 
 
172
 
173
 
174
  /* L脥NEAS DIVISORIAS */
 
296
  fn=analyze_sentiment,
297
  outputs=[gr.HTML(label="Sentiment"), gr.Label(num_top_classes=3, label="Scores"), gr.JSON(label="Raw Output", visible=False)], # Labels de salida m谩s cortos
298
  cache_examples=False,
299
+ # ELIMINADO: elem_classes="example-buttons-row"
300
  )
301
 
302
  gr.Markdown("<hr>")