Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
|
@@ -676,29 +676,31 @@ try:
|
|
| 676 |
pass
|
| 677 |
printV("Pie1 files written",4)
|
| 678 |
with col1_1:
|
| 679 |
-
|
| 680 |
-
|
| 681 |
-
|
| 682 |
-
|
| 683 |
-
|
| 684 |
-
|
| 685 |
-
|
| 686 |
-
|
| 687 |
-
|
| 688 |
-
|
| 689 |
-
|
| 690 |
-
|
|
|
|
| 691 |
with col1_2:
|
| 692 |
-
|
| 693 |
-
|
| 694 |
-
|
| 695 |
-
|
| 696 |
-
|
| 697 |
-
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
|
| 701 |
-
|
|
|
|
| 702 |
printV("Pie1 post plotly",4)
|
| 703 |
|
| 704 |
with pie2:
|
|
@@ -726,25 +728,27 @@ try:
|
|
| 726 |
except Exception:
|
| 727 |
pass
|
| 728 |
with col2_1:
|
| 729 |
-
|
| 730 |
-
|
| 731 |
-
|
| 732 |
-
|
| 733 |
-
|
| 734 |
-
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
|
|
|
| 738 |
with col2_2:
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
|
| 743 |
-
|
| 744 |
-
|
| 745 |
-
|
| 746 |
-
|
| 747 |
-
|
|
|
|
| 748 |
|
| 749 |
with sunburst1:
|
| 750 |
df5 = st.session_state.summaries[currFileIndex]["df5"].copy()
|
|
@@ -782,25 +786,27 @@ try:
|
|
| 782 |
except Exception:
|
| 783 |
pass
|
| 784 |
with col3_1:
|
| 785 |
-
|
| 786 |
-
|
| 787 |
-
|
| 788 |
-
|
| 789 |
-
|
| 790 |
-
|
| 791 |
-
|
| 792 |
-
|
| 793 |
-
|
|
|
|
| 794 |
with col3_2:
|
| 795 |
-
|
| 796 |
-
|
| 797 |
-
|
| 798 |
-
|
| 799 |
-
|
| 800 |
-
|
| 801 |
-
|
| 802 |
-
|
| 803 |
-
|
|
|
|
| 804 |
|
| 805 |
with treemap1:
|
| 806 |
df5 = st.session_state.summaries[currFileIndex]["df5"].copy()
|
|
@@ -838,26 +844,27 @@ try:
|
|
| 838 |
except Exception:
|
| 839 |
pass
|
| 840 |
with col4_1:
|
| 841 |
-
|
| 842 |
-
|
| 843 |
-
|
| 844 |
-
|
| 845 |
-
|
| 846 |
-
|
| 847 |
-
|
| 848 |
-
|
| 849 |
-
|
|
|
|
| 850 |
with col4_2:
|
| 851 |
-
|
| 852 |
-
|
| 853 |
-
|
| 854 |
-
|
| 855 |
-
|
| 856 |
-
|
| 857 |
-
|
| 858 |
-
|
| 859 |
-
|
| 860 |
-
|
| 861 |
|
| 862 |
# generate plotting window
|
| 863 |
|
|
@@ -899,25 +906,27 @@ try:
|
|
| 899 |
except Exception:
|
| 900 |
pass
|
| 901 |
with col5_1:
|
| 902 |
-
|
| 903 |
-
|
| 904 |
-
|
| 905 |
-
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
|
| 909 |
-
|
| 910 |
-
|
|
|
|
| 911 |
with col5_2:
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
-
|
| 917 |
-
|
| 918 |
-
|
| 919 |
-
|
| 920 |
-
|
|
|
|
| 921 |
|
| 922 |
with bar1:
|
| 923 |
df2 = st.session_state.summaries[currFileIndex]["df2"].copy()
|
|
@@ -950,25 +959,27 @@ try:
|
|
| 950 |
except Exception:
|
| 951 |
pass
|
| 952 |
with col6_1:
|
| 953 |
-
|
| 954 |
-
|
| 955 |
-
|
| 956 |
-
|
| 957 |
-
|
| 958 |
-
|
| 959 |
-
|
| 960 |
-
|
| 961 |
-
|
|
|
|
| 962 |
with col6_2:
|
| 963 |
-
|
| 964 |
-
|
| 965 |
-
|
| 966 |
-
|
| 967 |
-
|
| 968 |
-
|
| 969 |
-
|
| 970 |
-
|
| 971 |
-
|
|
|
|
| 972 |
|
| 973 |
except ValueError:
|
| 974 |
pass
|
|
|
|
| 676 |
pass
|
| 677 |
printV("Pie1 files written",4)
|
| 678 |
with col1_1:
|
| 679 |
+
if os.path.exists('ascn_pie1.pdf'):
|
| 680 |
+
printV("Pie1 in col1_1",4)
|
| 681 |
+
with open('ascn_pie1.pdf','rb') as f:
|
| 682 |
+
printV("Pie1 in file open",4)
|
| 683 |
+
st.download_button(
|
| 684 |
+
"Save As PDF",
|
| 685 |
+
f,
|
| 686 |
+
'sonogram-voice-category-'+currPlainName+'.pdf',
|
| 687 |
+
'application/pdf',
|
| 688 |
+
key='download-pdf1',
|
| 689 |
+
on_click="ignore",
|
| 690 |
+
)
|
| 691 |
+
printV("Pie1 after col1_1",4)
|
| 692 |
with col1_2:
|
| 693 |
+
if os.path.exists('ascn_pie1.svg'):
|
| 694 |
+
with open('ascn_pie1.svg','rb') as f:
|
| 695 |
+
st.download_button(
|
| 696 |
+
"Save As SVG",
|
| 697 |
+
f,
|
| 698 |
+
'sonogram-voice-category-'+currPlainName+'.svg',
|
| 699 |
+
'image/svg+xml',
|
| 700 |
+
key='download-svg1',
|
| 701 |
+
on_click="ignore",
|
| 702 |
+
)
|
| 703 |
+
printV("Pie1 in col1_2",4)
|
| 704 |
printV("Pie1 post plotly",4)
|
| 705 |
|
| 706 |
with pie2:
|
|
|
|
| 728 |
except Exception:
|
| 729 |
pass
|
| 730 |
with col2_1:
|
| 731 |
+
if os.path.exists('ascn_pie2.pdf'):
|
| 732 |
+
with open('ascn_pie2.pdf','rb') as f:
|
| 733 |
+
st.download_button(
|
| 734 |
+
"Save As PDF",
|
| 735 |
+
f,
|
| 736 |
+
'sonogram-speaker-percent-'+currPlainName+'.pdf',
|
| 737 |
+
'application/pdf',
|
| 738 |
+
key='download-pdf2',
|
| 739 |
+
on_click="ignore",
|
| 740 |
+
)
|
| 741 |
with col2_2:
|
| 742 |
+
if os.path.exists('ascn_pie2.svg'):
|
| 743 |
+
with open('ascn_pie2.svg','rb') as f:
|
| 744 |
+
st.download_button(
|
| 745 |
+
"Save As SVG",
|
| 746 |
+
f,
|
| 747 |
+
'sonogram-speaker-percent-'+currPlainName+'.svg',
|
| 748 |
+
'image/svg+xml',
|
| 749 |
+
key='download-svg2',
|
| 750 |
+
on_click="ignore",
|
| 751 |
+
)
|
| 752 |
|
| 753 |
with sunburst1:
|
| 754 |
df5 = st.session_state.summaries[currFileIndex]["df5"].copy()
|
|
|
|
| 786 |
except Exception:
|
| 787 |
pass
|
| 788 |
with col3_1:
|
| 789 |
+
if os.path.exists('ascn_sunburst.pdf'):
|
| 790 |
+
with open('ascn_sunburst.pdf','rb') as f:
|
| 791 |
+
st.download_button(
|
| 792 |
+
"Save As PDF",
|
| 793 |
+
f,
|
| 794 |
+
'sonogram-speaker-categories-'+currPlainName+'.pdf',
|
| 795 |
+
'application/pdf',
|
| 796 |
+
key='download-pdf3',
|
| 797 |
+
on_click="ignore",
|
| 798 |
+
)
|
| 799 |
with col3_2:
|
| 800 |
+
if os.path.exists('ascn_sunburst.svg'):
|
| 801 |
+
with open('ascn_sunburst.svg','rb') as f:
|
| 802 |
+
st.download_button(
|
| 803 |
+
"Save As SVG",
|
| 804 |
+
f,
|
| 805 |
+
'sonogram-speaker-categories-'+currPlainName+'.svg',
|
| 806 |
+
'image/svg+xml',
|
| 807 |
+
key='download-svg3',
|
| 808 |
+
on_click="ignore",
|
| 809 |
+
)
|
| 810 |
|
| 811 |
with treemap1:
|
| 812 |
df5 = st.session_state.summaries[currFileIndex]["df5"].copy()
|
|
|
|
| 844 |
except Exception:
|
| 845 |
pass
|
| 846 |
with col4_1:
|
| 847 |
+
if os.path.exists('ascn_treemap.pdf'):
|
| 848 |
+
with open('ascn_treemap.pdf','rb') as f:
|
| 849 |
+
st.download_button(
|
| 850 |
+
"Save As PDF",
|
| 851 |
+
f,
|
| 852 |
+
'sonogram-treemap-'+currPlainName+'.pdf',
|
| 853 |
+
'application/pdf',
|
| 854 |
+
key='download-pdf4',
|
| 855 |
+
on_click="ignore",
|
| 856 |
+
)
|
| 857 |
with col4_2:
|
| 858 |
+
if os.path.exists('ascn_treemap.svg'):
|
| 859 |
+
with open('ascn_treemap.svg','rb') as f:
|
| 860 |
+
st.download_button(
|
| 861 |
+
"Save As SVG",
|
| 862 |
+
f,
|
| 863 |
+
'sonogram-treemap-'+currPlainName+'.svg',
|
| 864 |
+
'image/svg+xml',
|
| 865 |
+
key='download-svg4',
|
| 866 |
+
on_click="ignore",
|
| 867 |
+
)
|
| 868 |
|
| 869 |
# generate plotting window
|
| 870 |
|
|
|
|
| 906 |
except Exception:
|
| 907 |
pass
|
| 908 |
with col5_1:
|
| 909 |
+
if os.path.exists('ascn_timeline.pdf'):
|
| 910 |
+
with open('ascn_timeline.pdf','rb') as f:
|
| 911 |
+
st.download_button(
|
| 912 |
+
"Save As PDF",
|
| 913 |
+
f,
|
| 914 |
+
'sonogram-timeline-'+currPlainName+'.pdf',
|
| 915 |
+
'application/pdf',
|
| 916 |
+
key='download-pdf5',
|
| 917 |
+
on_click="ignore",
|
| 918 |
+
)
|
| 919 |
with col5_2:
|
| 920 |
+
if os.path.exists('ascn_timeline.svg'):
|
| 921 |
+
with open('ascn_timeline.svg','rb') as f:
|
| 922 |
+
st.download_button(
|
| 923 |
+
"Save As SVG",
|
| 924 |
+
f,
|
| 925 |
+
'sonogram-timeline-'+currPlainName+'.svg',
|
| 926 |
+
'image/svg+xml',
|
| 927 |
+
key='download-svg5',
|
| 928 |
+
on_click="ignore",
|
| 929 |
+
)
|
| 930 |
|
| 931 |
with bar1:
|
| 932 |
df2 = st.session_state.summaries[currFileIndex]["df2"].copy()
|
|
|
|
| 959 |
except Exception:
|
| 960 |
pass
|
| 961 |
with col6_1:
|
| 962 |
+
if os.path.exists('ascn_bar.pdf'):
|
| 963 |
+
with open('ascn_bar.pdf','rb') as f:
|
| 964 |
+
st.download_button(
|
| 965 |
+
"Save As PDF",
|
| 966 |
+
f,
|
| 967 |
+
'sonogram-speaker-time-'+currPlainName+'.pdf',
|
| 968 |
+
'application/pdf',
|
| 969 |
+
key='download-pdf6',
|
| 970 |
+
on_click="ignore",
|
| 971 |
+
)
|
| 972 |
with col6_2:
|
| 973 |
+
if os.path.exists('ascn_bar.svg'):
|
| 974 |
+
with open('ascn_bar.svg','rb') as f:
|
| 975 |
+
st.download_button(
|
| 976 |
+
"Save As SVG",
|
| 977 |
+
f,
|
| 978 |
+
'sonogram-speaker-time-'+currPlainName+'.svg',
|
| 979 |
+
'image/svg+xml',
|
| 980 |
+
key='download-svg6',
|
| 981 |
+
on_click="ignore",
|
| 982 |
+
)
|
| 983 |
|
| 984 |
except ValueError:
|
| 985 |
pass
|