Upload app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
-
|
| 4 |
from inflections_funcs import start_model, make_beams, get_beam_tokens, calculate_score_vectors
|
| 5 |
|
| 6 |
# Global model initialization
|
|
@@ -14,7 +14,7 @@ def generate_beam_html(index, all_beams_data, dark_mode):
|
|
| 14 |
"""
|
| 15 |
beam_tokens = all_beams_data["beam_tokens"][index]
|
| 16 |
beam_scores = all_beams_data["score_vectors"][index]
|
| 17 |
-
beam_overall_score = exp(all_beams_data["sequences_scores"][index])
|
| 18 |
|
| 19 |
# Construct Main HTML output
|
| 20 |
main_container_style = "border: 2px solid lightblue; padding: 15px; border-radius: 8px; font-family: sans-serif;"
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import spaces
|
| 3 |
+
import math
|
| 4 |
from inflections_funcs import start_model, make_beams, get_beam_tokens, calculate_score_vectors
|
| 5 |
|
| 6 |
# Global model initialization
|
|
|
|
| 14 |
"""
|
| 15 |
beam_tokens = all_beams_data["beam_tokens"][index]
|
| 16 |
beam_scores = all_beams_data["score_vectors"][index]
|
| 17 |
+
beam_overall_score = math.exp(all_beams_data["sequences_scores"][index])
|
| 18 |
|
| 19 |
# Construct Main HTML output
|
| 20 |
main_container_style = "border: 2px solid lightblue; padding: 15px; border-radius: 8px; font-family: sans-serif;"
|