JUNGU commited on
Commit
78798de
ยท
1 Parent(s): f4de003

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -6
app.py CHANGED
@@ -105,9 +105,21 @@ if st.button("ํ‰๊ฐ€ ์ƒ์„ฑ"):
105
  selected_index = st.radio("๋ฌธ์žฅ์„ ์„ ํƒํ•˜์„ธ์š”:", range(len(sentences)), format_func=lambda x: sentences[x])
106
  st.session_state.selected_sentence = sentences[selected_index] if sentences else None
107
 
108
- # ์œ ์‚ฌํ•œ ๋ฌธ์žฅ ์ƒ์„ฑ ๋ฒ„ํŠผ ์ถ”๊ฐ€
109
- if st.button("์œ ์‚ฌํ•œ ๋ฌธ๊ตฌ ์ƒ์„ฑ") and st.session_state.get('selected_sentence'):
110
- with st.spinner('๋ฌธ์žฅ ์ƒ์„ฑ์ค‘...'):
111
- similar_sentences = generate_similar_sentences(st.session_state.selected_sentence)
112
- for sentence in st.session_state.similar_sentences:
113
- st.write(sentence)
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  selected_index = st.radio("๋ฌธ์žฅ์„ ์„ ํƒํ•˜์„ธ์š”:", range(len(sentences)), format_func=lambda x: sentences[x])
106
  st.session_state.selected_sentence = sentences[selected_index] if sentences else None
107
 
108
+ # # ์œ ์‚ฌํ•œ ๋ฌธ์žฅ ์ƒ์„ฑ ๋ฒ„ํŠผ ์ถ”๊ฐ€
109
+ # if st.button("์œ ์‚ฌํ•œ ๋ฌธ๊ตฌ ์ƒ์„ฑ") and st.session_state.get('selected_sentence'):
110
+ # with st.spinner('๋ฌธ์žฅ ์ƒ์„ฑ์ค‘...'):
111
+ # similar_sentences = generate_similar_sentences(st.session_state.selected_sentence)
112
+ # for sentence in st.session_state.similar_sentences:
113
+ # st.write(sentence)
114
+
115
+ # ์œ ์‚ฌํ•œ ๋ฌธ์žฅ ์ƒ์„ฑ ๋กœ์ง ๋ถ„๋ฆฌ
116
+ if st.session_state.get('selected_sentence'):
117
+ if st.button("์œ ์‚ฌํ•œ ๋ฌธ๊ตฌ ์ƒ์„ฑ"):
118
+ with st.spinner('๋ฌธ์žฅ ์ƒ์„ฑ์ค‘...'):
119
+ st.session_state.similar_sentences = generate_similar_sentences(st.session_state.selected_sentence)
120
+
121
+ # ์ƒ์„ฑ๋œ ๊ฒฐ๊ณผ ๋ฐ ์œ ์‚ฌํ•œ ๋ฌธ์žฅ๋“ค ์ถœ๋ ฅ
122
+ if st.session_state.get('generated_result'):
123
+ exec(st.session_state.generated_result.replace('```', ''))
124
+ for sentence in st.session_state.similar_sentences:
125
+ st.write(sentence)