Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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)
|