JUNGU commited on
Commit
1d1f4c3
โ€ข
1 Parent(s): 18d68ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -5,7 +5,7 @@ import os
5
 
6
 
7
  # OpenAI API ์„ค์ • (ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ์ฝ์–ด์˜ด)
8
- openai.api_key = os.getenv("OPENAI_API_KEY") # ์‹ค์ œ ์ฝ”๋“œ์—์„œ ์ฃผ์„ ํ•ด์ œ
9
 
10
  def main():
11
  st.title("GPT-3๋ฅผ ํ™œ์šฉํ•œ ๊ตญ์–ด ๋ฌธ์ œ ์ƒ์„ฑ๊ธฐ")
@@ -20,7 +20,9 @@ def main():
20
 
21
  st.text("์ง€๋ฌธ:")
22
  st.write(user_text)
23
-
 
 
24
  if st.button("ํ‚ค์›Œ๋“œ ์ฐพ๊ธฐ"):
25
 
26
  task_description ="""You are a useful helper that generates annotated text for Python's st-annotated-text library. Your task is to identify the topic of the passage and highlight the key words needed to convey the meaning. You should be able to identify the main points. Also, please mark keywords based on the different paragraphs and headings provided in the text. The output should be formatted in the following way:
@@ -56,9 +58,7 @@ def main():
56
  highlighted_text = response['choices'][0]['message']['content']
57
 
58
  exec(highlighted_text)
59
-
60
- # ํ…์ŠคํŠธ ์ž…๋ ฅ ๋ฐ•์Šค ์ถ”๊ฐ€
61
- user_input = st.text_input("๋ชจ๋ฅด๋Š” ๋ฌธ์žฅ์ด๋‚˜ ๋‹จ์–ด๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”:", "")
62
  # ํ…์ŠคํŠธ ๋ฒ„ํŠผ ์ถ”๊ฐ€
63
  if st.button("์ถ”๊ฐ€ ์„ค๋ช…"):
64
  # ์ž…๋ ฅ๋œ ํ…์ŠคํŠธ ์„ค๋ช…
@@ -82,5 +82,7 @@ def main():
82
  st.text("์„ค๋ช…:")
83
  st.write(explanation)
84
 
 
 
85
  if __name__ == "__main__":
86
  main()
 
5
 
6
 
7
  # OpenAI API ์„ค์ • (ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ์ฝ์–ด์˜ด)
8
+ openai.api_key = os.getenv("OPENAI_API_KEY")
9
 
10
  def main():
11
  st.title("GPT-3๋ฅผ ํ™œ์šฉํ•œ ๊ตญ์–ด ๋ฌธ์ œ ์ƒ์„ฑ๊ธฐ")
 
20
 
21
  st.text("์ง€๋ฌธ:")
22
  st.write(user_text)
23
+ # ํ…์ŠคํŠธ ์ž…๋ ฅ ๋ฐ•์Šค ์ถ”๊ฐ€
24
+ user_input = st.text_input("๋ชจ๋ฅด๋Š” ๋ฌธ์žฅ์ด๋‚˜ ๋‹จ์–ด๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”:", "")
25
+
26
  if st.button("ํ‚ค์›Œ๋“œ ์ฐพ๊ธฐ"):
27
 
28
  task_description ="""You are a useful helper that generates annotated text for Python's st-annotated-text library. Your task is to identify the topic of the passage and highlight the key words needed to convey the meaning. You should be able to identify the main points. Also, please mark keywords based on the different paragraphs and headings provided in the text. The output should be formatted in the following way:
 
58
  highlighted_text = response['choices'][0]['message']['content']
59
 
60
  exec(highlighted_text)
61
+
 
 
62
  # ํ…์ŠคํŠธ ๋ฒ„ํŠผ ์ถ”๊ฐ€
63
  if st.button("์ถ”๊ฐ€ ์„ค๋ช…"):
64
  # ์ž…๋ ฅ๋œ ํ…์ŠคํŠธ ์„ค๋ช…
 
82
  st.text("์„ค๋ช…:")
83
  st.write(explanation)
84
 
85
+
86
+
87
  if __name__ == "__main__":
88
  main()