NKessler commited on
Commit
c6b218c
·
verified ·
1 Parent(s): 81cf330

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -13
app.py CHANGED
@@ -4,7 +4,6 @@ import plotly.graph_objects as go
4
  import streamlit as st
5
  import json
6
  from openai import OpenAI
7
- import concurrent.futures
8
  import textstat
9
  import trafilatura
10
  import requests
@@ -282,13 +281,19 @@ st.markdown("""
282
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
283
  }
284
 
 
 
 
 
 
 
 
 
 
285
  [data-testid="stMetricValue"] > div {
286
  color: #0f172a;
287
  font-weight: 700 !important;
288
- font-size: 1.5rem !important;
289
- white-space: normal !important;
290
- line-height: 1.2 !important;
291
- overflow-wrap: break-word;
292
  }
293
 
294
  [data-testid="stMetricLabel"] > div {
@@ -351,14 +356,13 @@ if execute_analysis:
351
 
352
  with st.spinner("Analyzing both sources."):
353
  try:
354
- with concurrent.futures.ThreadPoolExecutor() as executor:
355
- future_a = executor.submit(get_cached_analysis, text_a_clean)
356
- future_b = executor.submit(get_cached_analysis, text_b_clean)
357
- future_nli = executor.submit(get_cached_contradiction, text_a_clean, text_b_clean)
358
-
359
- st.session_state.results_a = future_a.result()
360
- st.session_state.results_b = future_b.result()
361
- st.session_state.nli_result = future_nli.result()
362
 
363
  except Exception as e:
364
  error_msg = str(e)
 
4
  import streamlit as st
5
  import json
6
  from openai import OpenAI
 
7
  import textstat
8
  import trafilatura
9
  import requests
 
281
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
282
  }
283
 
284
+ [data-testid="stMetricValue"], [data-testid="stMetricValue"] * {
285
+ white-space: normal !important;
286
+ overflow-wrap: break-word !important;
287
+ word-wrap: break-word !important;
288
+ overflow: visible !important;
289
+ text-overflow: clip !important;
290
+ line-height: 1.25 !important;
291
+ }
292
+
293
  [data-testid="stMetricValue"] > div {
294
  color: #0f172a;
295
  font-weight: 700 !important;
296
+ font-size: 1.3rem !important;
 
 
 
297
  }
298
 
299
  [data-testid="stMetricLabel"] > div {
 
356
 
357
  with st.spinner("Analyzing both sources."):
358
  try:
359
+ res_a = get_cached_analysis(text_a_clean)
360
+ res_b = get_cached_analysis(text_b_clean)
361
+ res_nli = get_cached_contradiction(text_a_clean, text_b_clean)
362
+
363
+ st.session_state.results_a = res_a
364
+ st.session_state.results_b = res_b
365
+ st.session_state.nli_result = res_nli
 
366
 
367
  except Exception as e:
368
  error_msg = str(e)