Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1615,7 +1615,7 @@ def read_ai_dataset_selection():
|
|
| 1615 |
return selected_dataset_ai
|
| 1616 |
|
| 1617 |
def create_trust_score_1():
|
| 1618 |
-
score = 8
|
| 1619 |
max_score = 10
|
| 1620 |
fig, ax = plt.subplots(figsize=(2, 2), subplot_kw=dict(aspect="equal"))
|
| 1621 |
values = [score, max_score - score]
|
|
@@ -1626,7 +1626,6 @@ def create_trust_score_1():
|
|
| 1626 |
fig.suptitle('Trust Score 1', fontsize=10)
|
| 1627 |
return fig
|
| 1628 |
|
| 1629 |
-
|
| 1630 |
def create_trust_score_2():
|
| 1631 |
score = 7.5
|
| 1632 |
max_score = 10
|
|
@@ -1640,7 +1639,6 @@ def create_trust_score_2():
|
|
| 1640 |
return fig
|
| 1641 |
|
| 1642 |
def plot_to_base64(fig):
|
| 1643 |
-
import io
|
| 1644 |
buf = io.BytesIO()
|
| 1645 |
fig.savefig(buf, format="png")
|
| 1646 |
buf.seek(0)
|
|
@@ -1655,7 +1653,6 @@ def display_trust_score_2():
|
|
| 1655 |
fig2 = create_trust_score_2()
|
| 1656 |
return plot_to_base64(fig2)
|
| 1657 |
|
| 1658 |
-
|
| 1659 |
|
| 1660 |
def update_ai_dataset_selection(selection):
|
| 1661 |
global selected_dataset_ai
|
|
@@ -1721,7 +1718,7 @@ with gr.Blocks() as demo:
|
|
| 1721 |
vw_prospects_btn = gr.Button("VW Prospects")
|
| 1722 |
|
| 1723 |
with gr.Row():
|
| 1724 |
-
trust_score_output = gr.
|
| 1725 |
|
| 1726 |
|
| 1727 |
|
|
|
|
| 1615 |
return selected_dataset_ai
|
| 1616 |
|
| 1617 |
def create_trust_score_1():
|
| 1618 |
+
score = 8.5
|
| 1619 |
max_score = 10
|
| 1620 |
fig, ax = plt.subplots(figsize=(2, 2), subplot_kw=dict(aspect="equal"))
|
| 1621 |
values = [score, max_score - score]
|
|
|
|
| 1626 |
fig.suptitle('Trust Score 1', fontsize=10)
|
| 1627 |
return fig
|
| 1628 |
|
|
|
|
| 1629 |
def create_trust_score_2():
|
| 1630 |
score = 7.5
|
| 1631 |
max_score = 10
|
|
|
|
| 1639 |
return fig
|
| 1640 |
|
| 1641 |
def plot_to_base64(fig):
|
|
|
|
| 1642 |
buf = io.BytesIO()
|
| 1643 |
fig.savefig(buf, format="png")
|
| 1644 |
buf.seek(0)
|
|
|
|
| 1653 |
fig2 = create_trust_score_2()
|
| 1654 |
return plot_to_base64(fig2)
|
| 1655 |
|
|
|
|
| 1656 |
|
| 1657 |
def update_ai_dataset_selection(selection):
|
| 1658 |
global selected_dataset_ai
|
|
|
|
| 1718 |
vw_prospects_btn = gr.Button("VW Prospects")
|
| 1719 |
|
| 1720 |
with gr.Row():
|
| 1721 |
+
trust_score_output = gr.Image(type="plot")
|
| 1722 |
|
| 1723 |
|
| 1724 |
|