Spaces:
Runtime error
Runtime error
update: ui korean to english
Browse files
app.py
CHANGED
@@ -13,28 +13,28 @@ from pptx import Presentation
|
|
13 |
|
14 |
import presentation_assistant.presentation_assistant as pa
|
15 |
|
16 |
-
tab1, tab2, tab3 = st.tabs(['PA
|
17 |
|
18 |
with tab1:
|
19 |
-
st.header('
|
20 |
st.title('PA!(Presentation Assistant):sparkles:')
|
21 |
contents = """
|
22 |
-
βΆ
|
23 |
-
|
24 |
st.markdown(contents)
|
25 |
st.markdown('-------------------------')
|
26 |
-
st.header('
|
27 |
st.subheader('Text2PPT')
|
28 |
contents = """
|
29 |
-
βΆ
|
30 |
-
|
31 |
st.markdown(contents)
|
32 |
st.subheader('PPT2Script')
|
33 |
contents = """
|
34 |
-
βΆ PPT
|
35 |
st.markdown(contents)
|
36 |
|
37 |
-
#
|
38 |
# test_ppt_theme = "--reference-doc="+"/home/user/app/template/blue"+".pptx"
|
39 |
# subprocess.run(["/home/user/app/pandoc-2.14.2/bin/pandoc", "text2ppt_test.md", "-t", "pptx", test_ppt_theme, "-o", "output.pptx"], capture_output=True)
|
40 |
# print(os.listdir(os.getcwd()))
|
@@ -49,13 +49,13 @@ with tab1:
|
|
49 |
|
50 |
with tab2:
|
51 |
st.header('Text2PPT')
|
52 |
-
gpt_token = st.text_input('
|
53 |
st.markdown('-------------------------')
|
54 |
|
55 |
-
st.subheader(':computer: PPT
|
56 |
|
57 |
thema_select = st.selectbox(
|
58 |
-
'
|
59 |
['default', 'yellow', 'gradation_green', 'blue', 'green', 'custom'])
|
60 |
|
61 |
if thema_select == "custom":
|
@@ -63,24 +63,24 @@ with tab2:
|
|
63 |
|
64 |
st.markdown('-------------------------')
|
65 |
|
66 |
-
page_choice = st.slider('PPT
|
67 |
|
68 |
st.markdown('-------------------------')
|
69 |
|
70 |
-
my_order = ['
|
71 |
-
status = st.radio('
|
72 |
|
73 |
-
#
|
74 |
if status == my_order[0]:
|
75 |
-
input_text = st.text_area('TEXT
|
76 |
|
77 |
elif status == my_order[1]:
|
78 |
-
input_text = st.text_area('URL
|
79 |
|
80 |
elif status == my_order[2]:
|
81 |
-
input_text = st.file_uploader('PDF
|
82 |
|
83 |
-
input_text_check = st.button('
|
84 |
|
85 |
st.markdown('-------------------------')
|
86 |
|
@@ -98,21 +98,21 @@ with tab2:
|
|
98 |
|
99 |
with tab3:
|
100 |
st.header('PPT2Script')
|
101 |
-
st.subheader(':computer: Script
|
102 |
-
gpt_token = st.text_input('
|
103 |
st.markdown('-------------------------')
|
104 |
|
105 |
-
st.subheader(':bookmark_tabs
|
106 |
|
107 |
file_order = ['PDF', 'PPT']
|
108 |
-
choose = st.radio('
|
109 |
|
110 |
if choose == file_order[0]:
|
111 |
uploaded_file = st.file_uploader('Choose File!', type='pdf', key="<PPT2Script_pdf_uploader>")
|
112 |
elif choose == file_order[1]:
|
113 |
uploaded_file = st.file_uploader('Choose File!', type='pptx', key="<PPT2Script_ppt_uploader>")
|
114 |
|
115 |
-
input_file_check = st.button('
|
116 |
st.markdown('-------------------------')
|
117 |
|
118 |
if input_file_check == True:
|
@@ -125,4 +125,3 @@ with tab3:
|
|
125 |
st.success('Done!')
|
126 |
st.download_button('Download Script',
|
127 |
data=script, file_name="script_output.txt", key="<PPT2Script_download>")
|
128 |
-
|
|
|
13 |
|
14 |
import presentation_assistant.presentation_assistant as pa
|
15 |
|
16 |
+
tab1, tab2, tab3 = st.tabs(['What is PA!?', 'Text2PPT', 'PPT2Script'])
|
17 |
|
18 |
with tab1:
|
19 |
+
st.header('Introduction')
|
20 |
st.title('PA!(Presentation Assistant):sparkles:')
|
21 |
contents = """
|
22 |
+
βΆ Based on the content entered by the user, it :blue[automatically creates] PPT and
|
23 |
+
provides a presentation :red[script] to improve presentation skills!"""
|
24 |
st.markdown(contents)
|
25 |
st.markdown('-------------------------')
|
26 |
+
st.header('How to use')
|
27 |
st.subheader('Text2PPT')
|
28 |
contents = """
|
29 |
+
βΆ If the user provides a link or file, we will :blue[create a presentation material] for you!
|
30 |
+
The user only needs to select the desired theme (template) type and number of pages!"""
|
31 |
st.markdown(contents)
|
32 |
st.subheader('PPT2Script')
|
33 |
contents = """
|
34 |
+
βΆ If the user provides PPT or PDF presentation materials, we will automatically create a :blue[presentation script] for you!"""
|
35 |
st.markdown(contents)
|
36 |
|
37 |
+
# Test
|
38 |
# test_ppt_theme = "--reference-doc="+"/home/user/app/template/blue"+".pptx"
|
39 |
# subprocess.run(["/home/user/app/pandoc-2.14.2/bin/pandoc", "text2ppt_test.md", "-t", "pptx", test_ppt_theme, "-o", "output.pptx"], capture_output=True)
|
40 |
# print(os.listdir(os.getcwd()))
|
|
|
49 |
|
50 |
with tab2:
|
51 |
st.header('Text2PPT')
|
52 |
+
gpt_token = st.text_input('Please enter your ChatGPT API token.', key="<Text2PPT_token>")
|
53 |
st.markdown('-------------------------')
|
54 |
|
55 |
+
st.subheader(':computer: PPT Auto Generator :computer:')
|
56 |
|
57 |
thema_select = st.selectbox(
|
58 |
+
'Please select the template you want.',
|
59 |
['default', 'yellow', 'gradation_green', 'blue', 'green', 'custom'])
|
60 |
|
61 |
if thema_select == "custom":
|
|
|
63 |
|
64 |
st.markdown('-------------------------')
|
65 |
|
66 |
+
page_choice = st.slider('Number of PPT pages', min_value=2, max_value=10, step=1, value=5)
|
67 |
|
68 |
st.markdown('-------------------------')
|
69 |
|
70 |
+
my_order = ['Text', 'Link', 'PDF']
|
71 |
+
status = st.radio('Please select the file type and enter the content! :smile: ', my_order)
|
72 |
|
73 |
+
# First method
|
74 |
if status == my_order[0]:
|
75 |
+
input_text = st.text_area('Enter TEXT', height=5)
|
76 |
|
77 |
elif status == my_order[1]:
|
78 |
+
input_text = st.text_area('Enter URL', height=5)
|
79 |
|
80 |
elif status == my_order[2]:
|
81 |
+
input_text = st.file_uploader('Upload PDF', type=['pdf'])
|
82 |
|
83 |
+
input_text_check = st.button('Confirm', key="<Text2PPT_start>")
|
84 |
|
85 |
st.markdown('-------------------------')
|
86 |
|
|
|
98 |
|
99 |
with tab3:
|
100 |
st.header('PPT2Script')
|
101 |
+
st.subheader(':computer: Script Auto Generator :computer:')
|
102 |
+
gpt_token = st.text_input('Please enter your ChatGPT API token.', key="<PPT2Script_token>")
|
103 |
st.markdown('-------------------------')
|
104 |
|
105 |
+
st.subheader(':bookmark_tabs:Presentation Script Generator')
|
106 |
|
107 |
file_order = ['PDF', 'PPT']
|
108 |
+
choose = st.radio('Please select the file format of the presentation material', file_order)
|
109 |
|
110 |
if choose == file_order[0]:
|
111 |
uploaded_file = st.file_uploader('Choose File!', type='pdf', key="<PPT2Script_pdf_uploader>")
|
112 |
elif choose == file_order[1]:
|
113 |
uploaded_file = st.file_uploader('Choose File!', type='pptx', key="<PPT2Script_ppt_uploader>")
|
114 |
|
115 |
+
input_file_check = st.button('Confirm', key="<PPT2Script_start>") # When this button is pressed, the input file should be passed
|
116 |
st.markdown('-------------------------')
|
117 |
|
118 |
if input_file_check == True:
|
|
|
125 |
st.success('Done!')
|
126 |
st.download_button('Download Script',
|
127 |
data=script, file_name="script_output.txt", key="<PPT2Script_download>")
|
|