Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -144,6 +144,8 @@ def get_reading(question, selected_cards):
|
|
144 |
return result + "\n\n๐ May these insights guide your path! ๐"
|
145 |
|
146 |
|
|
|
|
|
147 |
demo = gr.Interface(
|
148 |
fn=get_reading,
|
149 |
inputs=[
|
@@ -152,11 +154,10 @@ demo = gr.Interface(
|
|
152 |
placeholder="Enter your question here...",
|
153 |
lines=3
|
154 |
),
|
155 |
-
gr.
|
156 |
choices=list(tarot_cards.keys()),
|
157 |
label="๐ด Select Your Cards (Max 5)",
|
158 |
-
info="Choose 1-5 cards for your reading"
|
159 |
-
max_choices=5
|
160 |
)
|
161 |
],
|
162 |
outputs=gr.Textbox(
|
@@ -210,6 +211,19 @@ demo = gr.Interface(
|
|
210 |
"""
|
211 |
)
|
212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
213 |
|
214 |
# Example questions
|
215 |
examples = [
|
|
|
144 |
return result + "\n\n๐ May these insights guide your path! ๐"
|
145 |
|
146 |
|
147 |
+
# ... (์ด์ ์ฝ๋๋ ๋์ผ)
|
148 |
+
|
149 |
demo = gr.Interface(
|
150 |
fn=get_reading,
|
151 |
inputs=[
|
|
|
154 |
placeholder="Enter your question here...",
|
155 |
lines=3
|
156 |
),
|
157 |
+
gr.CheckboxGroup( # CheckboxGroup์ผ๋ก ์์
|
158 |
choices=list(tarot_cards.keys()),
|
159 |
label="๐ด Select Your Cards (Max 5)",
|
160 |
+
info="Choose 1-5 cards for your reading"
|
|
|
161 |
)
|
162 |
],
|
163 |
outputs=gr.Textbox(
|
|
|
211 |
"""
|
212 |
)
|
213 |
|
214 |
+
# ์นด๋ ์ ํ ์ ํ์ ์ํ ํจ์ ์์
|
215 |
+
def validate_selection(selected_cards):
|
216 |
+
if len(selected_cards) > 5:
|
217 |
+
return selected_cards[:5]
|
218 |
+
return selected_cards
|
219 |
+
|
220 |
+
demo.input_components[1].change(
|
221 |
+
fn=validate_selection,
|
222 |
+
inputs=[demo.input_components[1]],
|
223 |
+
outputs=[demo.input_components[1]]
|
224 |
+
)
|
225 |
+
|
226 |
+
|
227 |
|
228 |
# Example questions
|
229 |
examples = [
|