JeCabrera commited on
Commit
c41973e
verified
1 Parent(s): 76f72b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -2
app.py CHANGED
@@ -309,8 +309,17 @@ with col2:
309
 
310
  # Display results if we have an offer result
311
  if st.session_state.generated:
312
- # With this line that uses the wrapper:
313
- st.markdown(get_response_html_wrapper(st.session_state.offer_result), unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
314
 
315
  # Add a small space
316
  st.markdown('<div style="height: 15px;"></div>', unsafe_allow_html=True)
 
309
 
310
  # Display results if we have an offer result
311
  if st.session_state.generated:
312
+ # Opci贸n para alternar entre vista renderizada y cruda
313
+ view_mode = st.radio("Modo de visualizaci贸n:", ["Renderizado", "Texto crudo"])
314
+
315
+ if view_mode == "Renderizado":
316
+ # Vista normal renderizada con el wrapper
317
+ st.markdown(get_response_html_wrapper(st.session_state.offer_result), unsafe_allow_html=True)
318
+ else:
319
+ # Vista de texto crudo - muestra exactamente lo que devuelve el modelo
320
+ st.text_area("Respuesta cruda:", st.session_state.offer_result, height=400)
321
+ # Opcionalmente, muestra la representaci贸n de bytes para detectar caracteres invisibles
322
+ st.code(repr(st.session_state.offer_result))
323
 
324
  # Add a small space
325
  st.markdown('<div style="height: 15px;"></div>', unsafe_allow_html=True)