Update app.py
Browse files
app.py
CHANGED
@@ -107,10 +107,11 @@ def get_word_probabilities(text):
|
|
107 |
current_word += token
|
108 |
current_probs.append(prob)
|
109 |
if current_word and current_probs:
|
110 |
-
word_probs.append(
|
111 |
except Exception as e:
|
112 |
print("Error during word aggregation:", e)
|
113 |
return []
|
|
|
114 |
|
115 |
return word_probs
|
116 |
|
|
|
107 |
current_word += token
|
108 |
current_probs.append(prob)
|
109 |
if current_word and current_probs:
|
110 |
+
word_probs.append(sum(current_probs) / len(current_probs))
|
111 |
except Exception as e:
|
112 |
print("Error during word aggregation:", e)
|
113 |
return []
|
114 |
+
word_probs = [float(p) for p in word_probs]
|
115 |
|
116 |
return word_probs
|
117 |
|