AlexTransformer commited on
Commit
cea53ee
·
verified ·
1 Parent(s): e0a575e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -91,7 +91,8 @@ def analyze_text_both_models(text):
91
  if not text.strip():
92
  # Return empty components for both models
93
  return (None, None, "⚠️ Please enter some text to analyze",
94
- None, None, "⚠️ Please enter some text to analyze")
 
95
 
96
  results = {}
97
 
@@ -100,7 +101,7 @@ def analyze_text_both_models(text):
100
  token_log_probs, tokens, total_log_prob = calculate_token_log_probabilities(text, model_name)
101
 
102
  # Create visualization components
103
- df, fig = create_analysis_visualization(tokens, token_log_prob, total_log_prob, model_name)
104
 
105
  # Create summary text
106
  avg_prob = math.exp(total_log_prob / len(token_log_probs)) if token_log_probs else 0
 
91
  if not text.strip():
92
  # Return empty components for both models
93
  return (None, None, "⚠️ Please enter some text to analyze",
94
+ None, None, "⚠️ Please enter some text to analyze",
95
+ None, "⚠️ Please enter some text to analyze")
96
 
97
  results = {}
98
 
 
101
  token_log_probs, tokens, total_log_prob = calculate_token_log_probabilities(text, model_name)
102
 
103
  # Create visualization components
104
+ df, fig = create_analysis_visualization(tokens, token_log_probs, total_log_prob, model_name)
105
 
106
  # Create summary text
107
  avg_prob = math.exp(total_log_prob / len(token_log_probs)) if token_log_probs else 0