Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1613,7 +1613,7 @@ def chatbot_response(message, history):
|
|
| 1613 |
def read_ai_dataset_selection():
|
| 1614 |
global selected_dataset_ai
|
| 1615 |
return selected_dataset_ai
|
| 1616 |
-
|
| 1617 |
def create_trust_score_1():
|
| 1618 |
score = 8.5
|
| 1619 |
max_score = 10
|
|
@@ -1638,20 +1638,21 @@ def create_trust_score_2():
|
|
| 1638 |
fig.suptitle('Trust Score 2', fontsize=10)
|
| 1639 |
return fig
|
| 1640 |
|
| 1641 |
-
def
|
| 1642 |
buf = io.BytesIO()
|
| 1643 |
fig.savefig(buf, format="png")
|
| 1644 |
buf.seek(0)
|
| 1645 |
-
|
| 1646 |
-
return
|
| 1647 |
|
| 1648 |
def display_trust_score_1():
|
| 1649 |
fig1 = create_trust_score_1()
|
| 1650 |
-
return
|
| 1651 |
|
| 1652 |
def display_trust_score_2():
|
| 1653 |
fig2 = create_trust_score_2()
|
| 1654 |
-
return
|
|
|
|
| 1655 |
|
| 1656 |
|
| 1657 |
def update_ai_dataset_selection(selection):
|
|
@@ -1718,7 +1719,7 @@ with gr.Blocks() as demo:
|
|
| 1718 |
vw_prospects_btn = gr.Button("VW Prospects")
|
| 1719 |
|
| 1720 |
with gr.Row():
|
| 1721 |
-
trust_score_output = gr.Image(type="
|
| 1722 |
|
| 1723 |
|
| 1724 |
|
|
|
|
| 1613 |
def read_ai_dataset_selection():
|
| 1614 |
global selected_dataset_ai
|
| 1615 |
return selected_dataset_ai
|
| 1616 |
+
|
| 1617 |
def create_trust_score_1():
|
| 1618 |
score = 8.5
|
| 1619 |
max_score = 10
|
|
|
|
| 1638 |
fig.suptitle('Trust Score 2', fontsize=10)
|
| 1639 |
return fig
|
| 1640 |
|
| 1641 |
+
def plot_to_numpy(fig):
|
| 1642 |
buf = io.BytesIO()
|
| 1643 |
fig.savefig(buf, format="png")
|
| 1644 |
buf.seek(0)
|
| 1645 |
+
img = Image.open(buf)
|
| 1646 |
+
return np.array(img)
|
| 1647 |
|
| 1648 |
def display_trust_score_1():
|
| 1649 |
fig1 = create_trust_score_1()
|
| 1650 |
+
return plot_to_numpy(fig1)
|
| 1651 |
|
| 1652 |
def display_trust_score_2():
|
| 1653 |
fig2 = create_trust_score_2()
|
| 1654 |
+
return plot_to_numpy(fig2)
|
| 1655 |
+
|
| 1656 |
|
| 1657 |
|
| 1658 |
def update_ai_dataset_selection(selection):
|
|
|
|
| 1719 |
vw_prospects_btn = gr.Button("VW Prospects")
|
| 1720 |
|
| 1721 |
with gr.Row():
|
| 1722 |
+
trust_score_output = gr.Image(type="numpy")
|
| 1723 |
|
| 1724 |
|
| 1725 |
|