Hyeonseo commited on
Commit
194c66b
β€’
1 Parent(s): f2262cd

update: ui korean to english

Browse files
Files changed (1) hide show
  1. app.py +25 -26
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!λž€?', 'Text2PPT', 'PPT2Script'])
17
 
18
  with tab1:
19
- st.header('μ†Œκ°œ')
20
  st.title('PA!(Presentation Assistant):sparkles:')
21
  contents = """
22
- β–Ά μ‚¬μš©μžκ°€ μž…λ ₯ν•œ λ‚΄μš©μ„ 기반으둜 PPTλ₯Ό :blue[μžλ™ μ œμž‘]ν•˜κ³ ,
23
- ν”„λ ˆμ  ν…Œμ΄μ…˜ :red[슀크립트λ₯Ό 제곡]ν•˜μ—¬ ν”„λ ˆμ  ν…Œμ΄μ…˜ μ—­λŸ‰μ„ ν–₯μƒμ‹œν‚΅λ‹ˆλ‹€!"""
24
  st.markdown(contents)
25
  st.markdown('-------------------------')
26
- st.header('μ‚¬μš©λ²•')
27
  st.subheader('Text2PPT')
28
  contents = """
29
- β–Ά μ‚¬μš©μžμ—κ²Œ λ§ν¬λ‚˜ νŒŒμΌμ„ μ „λ‹¬λ°›μœΌλ©΄ κ·Έ λ‚΄μš©μœΌλ‘œ :blue[λ°œν‘œ 자료λ₯Ό μ œμž‘]ν•΄ λ“œλ¦½λ‹ˆλ‹€!
30
- μ‚¬μš©μžλŠ” μ›ν•˜λŠ” ν…Œλ§ˆ(ν…œν”Œλ¦Ώ) μ’…λ₯˜μ™€ νŽ˜μ΄μ§€ 수만 μ„ νƒν•˜μ„Έμš”!"""
31
  st.markdown(contents)
32
  st.subheader('PPT2Script')
33
  contents = """
34
- β–Ά PPT λ˜λŠ” PDF λ°œν‘œ 자료λ₯Ό μ‚¬μš©μžλ‘œλΆ€ν„° μ œκ³΅λ°›μœΌλ©΄ μžλ™μœΌλ‘œ :blue[λ°œν‘œ λŒ€λ³Έ]을 λ§Œλ“€μ–΄λ“œλ¦½λ‹ˆλ‹€!"""
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('μ±—GPT API 토큰을 μž…λ ₯ν•΄μ£Όμ„Έμš”.', key="<Text2PPT_token>")
53
  st.markdown('-------------------------')
54
 
55
- st.subheader(':computer: PPT μžλ™ 생성기 :computer:')
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 νŽ˜μ΄μ§€ μž₯수', min_value=2, max_value=10, step=1, value=5)
67
 
68
  st.markdown('-------------------------')
69
 
70
- my_order = ['ν…μŠ€νŠΈ', '링크', 'PDF']
71
- status = st.radio('파일 μ’…λ₯˜λ₯Ό μ„ νƒν•˜κ³  λ‚΄μš©μ„ μž…λ ₯ν•˜μ„Έμš”! :smile: ', my_order)
72
 
73
- # 첫번째 방법
74
  if status == my_order[0]:
75
- input_text = st.text_area('TEXTλ₯Ό μž…λ ₯ν•˜μ„Έμš”', height=5)
76
 
77
  elif status == my_order[1]:
78
- input_text = st.text_area('URL을 μž…λ ₯ν•˜μ„Έμš”', height=5)
79
 
80
  elif status == my_order[2]:
81
- input_text = st.file_uploader('PDFλ₯Ό μ—…λ‘œλ“œ ν•˜μ„Έμš”', type=['pdf'])
82
 
83
- input_text_check = st.button('확인', key="<Text2PPT_start>")
84
 
85
  st.markdown('-------------------------')
86
 
@@ -98,21 +98,21 @@ with tab2:
98
 
99
  with tab3:
100
  st.header('PPT2Script')
101
- st.subheader(':computer: Script μžλ™ 생성기 :computer:')
102
- gpt_token = st.text_input('μ±—GPT API 토큰을 μž…λ ₯ν•΄μ£Όμ„Έμš”.', key="<PPT2Script_token>")
103
  st.markdown('-------------------------')
104
 
105
- st.subheader(':bookmark_tabs:λ°œν‘œ λŒ€λ³Έ 생성기')
106
 
107
  file_order = ['PDF', 'PPT']
108
- choose = st.radio('λ°œν‘œ 자료의 파일 ν˜•μ‹μ„ 선택해 μ£Όμ„Έμš”', 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('확인', key="<PPT2Script_start>") # 이 λ²„νŠΌ λˆ„λ₯΄λ©΄ μž…λ ₯ 파일이 λ„˜μ–΄κ°€κ²Œ 해야함
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>")