Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import os
|
|
|
2 |
import gradio as gr
|
3 |
from gradio import ChatMessage
|
4 |
from typing import Iterator
|
@@ -54,6 +55,32 @@ for split in korean_food_dataset.keys():
|
|
54 |
sub_len = min(MAX_SAMPLES, len(ds_split))
|
55 |
korean_subset[split] = ds_split.select(range(sub_len))
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
|
58 |
def format_chat_history(messages: list) -> list:
|
59 |
"""
|
@@ -152,7 +179,6 @@ def stream_gemini_response(user_message: str, messages: list) -> Iterator[list]:
|
|
152 |
most_similar_data = find_most_similar_data(user_message)
|
153 |
|
154 |
# ์์คํ
๋ฉ์์ง์ ํ๋กฌํํธ ์ค์
|
155 |
-
# ์๋ system_prefix์์ '์์ + ๊ฑด๊ฐ + ๋ฌธํ + ์ญ์ฌ + ์๋ ๋ฅด๊ธฐ + ์์์ + ์นผ๋ก๋ฆฌ + ์ฝ๋ฌผ ๋ณต์ฉ' ๋ฑ ์ข
ํฉ ์๋ด๋ฅผ ๊ฐ์กฐ
|
156 |
system_message = (
|
157 |
"์ ๋ ์๋ก์ด ๋ง๊ณผ ๊ฑด๊ฐ์ ์ํ ํ์ ์ ์กฐ๋ฆฌ๋ฒ์ ์ ์ํ๊ณ , "
|
158 |
"ํ๊ตญ ์์์ ๋น๋กฏํ ๋ค์ํ ๋ ์ํผ ๋ฐ์ดํฐ์ ๊ฑด๊ฐ ์ง์์ ๊ฒฐํฉํ์ฌ "
|
@@ -183,9 +209,18 @@ def stream_gemini_response(user_message: str, messages: list) -> Iterator[list]:
|
|
183 |
"""
|
184 |
|
185 |
if most_similar_data:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
prefixed_message = (
|
187 |
f"{system_prefix} {system_message}\n\n"
|
188 |
-
f"[๊ด๋ จ ๋ฐ์ดํฐ]\n{most_similar_data}\n
|
|
|
189 |
f"์ฌ์ฉ์ ์ง๋ฌธ: {user_message}"
|
190 |
)
|
191 |
else:
|
@@ -271,7 +306,6 @@ def stream_gemini_response(user_message: str, messages: list) -> Iterator[list]:
|
|
271 |
)
|
272 |
yield messages
|
273 |
|
274 |
-
|
275 |
def stream_gemini_response_special(user_message: str, messages: list) -> Iterator[list]:
|
276 |
"""
|
277 |
ํน์ ์ง๋ฌธ(์: ๊ฑด๊ฐ ์๋จ ์ค๊ณ, ๋ง์ถคํ ์๋ฆฌ ๊ฐ๋ฐ ๋ฑ)์ ๋ํ Gemini์ ์๊ฐ๊ณผ ๋ต๋ณ์ ์คํธ๋ฆฌ๋ฐ
|
@@ -309,9 +343,18 @@ def stream_gemini_response_special(user_message: str, messages: list) -> Iterato
|
|
309 |
"""
|
310 |
|
311 |
if most_similar_data:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
312 |
prefixed_message = (
|
313 |
f"{system_prefix} {system_message}\n\n"
|
314 |
-
f"[๊ด๋ จ ์ ๋ณด]\n{most_similar_data}\n
|
|
|
315 |
f"์ฌ์ฉ์ ์ง๋ฌธ: {user_message}"
|
316 |
)
|
317 |
else:
|
@@ -435,9 +478,18 @@ def stream_gemini_response_personalized(user_message: str, messages: list) -> It
|
|
435 |
"""
|
436 |
|
437 |
if most_similar_data:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
438 |
prefixed_message = (
|
439 |
f"{system_prefix} {system_message}\n\n"
|
440 |
-
f"[๊ด๋ จ ๋ฐ์ดํฐ]\n{most_similar_data}\n
|
|
|
441 |
f"์ฌ์ฉ์ ์ง๋ฌธ: {user_message}"
|
442 |
)
|
443 |
else:
|
@@ -525,7 +577,6 @@ def user_message(msg: str, history: list) -> tuple[str, list]:
|
|
525 |
########################
|
526 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
527 |
########################
|
528 |
-
|
529 |
with gr.Blocks(
|
530 |
theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral"),
|
531 |
css="""
|
@@ -653,7 +704,7 @@ with gr.Blocks(
|
|
653 |
queue=False
|
654 |
)
|
655 |
|
656 |
-
# 3) ์ฌ์ฉ์ ๋ง์ถคํ ์์ ์ถ์ฒ
|
657 |
with gr.TabItem("์ฌ์ฉ์ ๋ง์ถคํ ์์ ์ถ์ฒ", id="personalized_cuisine_tab"):
|
658 |
personalized_chatbot = gr.Chatbot(
|
659 |
type="messages",
|
@@ -673,7 +724,6 @@ with gr.Blocks(
|
|
673 |
)
|
674 |
personalized_clear_button = gr.Button("๋ํ ์ด๊ธฐํ", scale=1)
|
675 |
|
676 |
-
# ์์
|
677 |
personalized_example_prompts = [
|
678 |
["์๋ ๋ฅด๊ธฐ๊ฐ (๊ฒฌ๊ณผ๋ฅ, ํด์ฐ๋ฌผ)์ด๊ณ , ํ์ ์ฝ์ ๋ณต์ฉ ์ค์
๋๋ค. ์ ์นผ๋ก๋ฆฌ ์ ์ผ์ ์ถ์ฒ ๋ถํ๋๋ฆฝ๋๋ค."],
|
679 |
["์ ๋น๋ถ๋ด์ฆ์ด ์์ด์ ์ ์ ํ์ ํผํ๊ณ ์ถ๊ณ , ๋จ๋ฐฑ์ง ์ญ์ทจ๊ฐ ์ค์ํฉ๋๋ค. ์๋จ ์กฐํฉ ์ข ์๋ ค์ฃผ์ธ์."],
|
@@ -710,6 +760,91 @@ with gr.Blocks(
|
|
710 |
queue=False
|
711 |
)
|
712 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
713 |
# ์ฌ์ฉ ๊ฐ์ด๋ ํญ
|
714 |
with gr.TabItem("์ด์ฉ ๋ฐฉ๋ฒ", id="instructions_tab"):
|
715 |
gr.Markdown(
|
@@ -726,13 +861,15 @@ with gr.Blocks(
|
|
726 |
- **ํ๊ตญ ์์ ํนํ**: ์ ํต ํ์ ๋ ์ํผ ๋ฐ ํ๊ตญ ์์ ๋ฐ์ดํฐ๋ฅผ ํตํด ๋ณด๋ค ํ๋ถํ ์ ์ ๊ฐ๋ฅ.
|
727 |
- **์ค์๊ฐ ์ถ๋ก (Thinking) ํ์**: ๋ต๋ณ ๊ณผ์ ์์ ๋ชจ๋ธ์ด ์๊ฐ์ ์ ๊ฐํ๋ ํ๋ฆ(์คํ์ ๊ธฐ๋ฅ)์ ๋ถ๋ถ์ ์ผ๋ก ํ์ธ.
|
728 |
- **๋ฐ์ดํฐ ๊ฒ์**: ๋ด๋ถ์ ์ผ๋ก ์ ํฉํ ์ ๋ณด๋ฅผ ์ฐพ์ ์ฌ์ฉ์ ์ง๋ฌธ์ ๋ํ ๋ต์ ํ๋ถํ๊ฒ ์ ๊ณต.
|
|
|
729 |
|
730 |
### ์ฌ์ฉ ๋ฐฉ๋ฒ
|
731 |
1. **'์ฐฝ์์ ๋ ์ํผ ๋ฐ ๊ฐ์ด๋' ํญ**: ์ผ๋ฐ์ ์ธ ์๋ฆฌ ์์ด๋์ด๋ ์์ ์ ๋ณด๋ฅผ ๋ฌธ์.
|
732 |
2. **'๋ง์ถคํ ์๋จ/๊ฑด๊ฐ' ํญ**: ํน์ ์งํ, ์ํฉ๋ณ(์คํฌ์ธ , ๋ค์ด์ดํธ ๋ฑ) ์๋จ/๋ ์ํผ ์๋ด.
|
733 |
3. **'์ฌ์ฉ์ ๋ง์ถคํ ์์ ์ถ์ฒ' ํญ**: ์๋ ๋ฅด๊ธฐ, ์ฝ๋ฌผ, ๊ฐ์ธ ์นผ๋ก๋ฆฌ ๋ชฉํ ๋ฑ ์ธ๋ถ ์กฐ๊ฑด์ ๊ณ ๋ คํ ์ต์ ์๋จ ์ถ์ฒ.
|
734 |
-
4.
|
735 |
-
5.
|
|
|
736 |
|
737 |
### ์ฐธ๊ณ ์ฌํญ
|
738 |
- **Thinking(์ถ๋ก ) ๊ธฐ๋ฅ**์ ๋ชจ๋ธ ๋ด๋ถ ๊ณผ์ ์ ์ผ๋ถ ๊ณต๊ฐํ์ง๋ง, ์ด๋ ์คํ์ ์ด๋ฉฐ ์ค์ ์๋น์ค์์๋ ๋น๊ณต๊ฐ๋ ์ ์์ต๋๋ค.
|
@@ -743,4 +880,4 @@ with gr.Blocks(
|
|
743 |
|
744 |
# Gradio ์น ์๋น์ค ์คํ
|
745 |
if __name__ == "__main__":
|
746 |
-
demo.launch(debug=True)
|
|
|
1 |
import os
|
2 |
+
import csv
|
3 |
import gradio as gr
|
4 |
from gradio import ChatMessage
|
5 |
from typing import Iterator
|
|
|
55 |
sub_len = min(MAX_SAMPLES, len(ds_split))
|
56 |
korean_subset[split] = ds_split.select(range(sub_len))
|
57 |
|
58 |
+
def find_related_restaurants(query: str, limit: int = 3) -> list:
|
59 |
+
"""
|
60 |
+
Query์ ๊ด๋ จ๋ ๋ฏธ์๋ฆฐ ๋ ์คํ ๋์ michelin_my_maps.csv์์ ์ฐพ์ ๋ฐํ
|
61 |
+
"""
|
62 |
+
try:
|
63 |
+
with open('michelin_my_maps.csv', 'r', encoding='utf-8') as f:
|
64 |
+
reader = csv.DictReader(f)
|
65 |
+
restaurants = list(reader)
|
66 |
+
|
67 |
+
# ๊ฐ๋จํ ํค์๋ ๋งค์นญ
|
68 |
+
related = []
|
69 |
+
query = query.lower()
|
70 |
+
for restaurant in restaurants:
|
71 |
+
if (query in restaurant.get('Cuisine', '').lower() or
|
72 |
+
query in restaurant.get('Description', '').lower()):
|
73 |
+
related.append(restaurant)
|
74 |
+
if len(related) >= limit:
|
75 |
+
break
|
76 |
+
|
77 |
+
return related
|
78 |
+
except FileNotFoundError:
|
79 |
+
print("Warning: michelin_my_maps.csv file not found")
|
80 |
+
return []
|
81 |
+
except Exception as e:
|
82 |
+
print(f"Error finding restaurants: {e}")
|
83 |
+
return []
|
84 |
|
85 |
def format_chat_history(messages: list) -> list:
|
86 |
"""
|
|
|
179 |
most_similar_data = find_most_similar_data(user_message)
|
180 |
|
181 |
# ์์คํ
๋ฉ์์ง์ ํ๋กฌํํธ ์ค์
|
|
|
182 |
system_message = (
|
183 |
"์ ๋ ์๋ก์ด ๋ง๊ณผ ๊ฑด๊ฐ์ ์ํ ํ์ ์ ์กฐ๋ฆฌ๋ฒ์ ์ ์ํ๊ณ , "
|
184 |
"ํ๊ตญ ์์์ ๋น๋กฏํ ๋ค์ํ ๋ ์ํผ ๋ฐ์ดํฐ์ ๊ฑด๊ฐ ์ง์์ ๊ฒฐํฉํ์ฌ "
|
|
|
209 |
"""
|
210 |
|
211 |
if most_similar_data:
|
212 |
+
# ๊ด๋ จ ๋ ์คํ ๋ ์ฐพ๊ธฐ
|
213 |
+
related_restaurants = find_related_restaurants(user_message)
|
214 |
+
restaurant_text = ""
|
215 |
+
if related_restaurants:
|
216 |
+
restaurant_text = "\n\n[๊ด๋ จ ๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ์ถ์ฒ]\n"
|
217 |
+
for rest in related_restaurants:
|
218 |
+
restaurant_text += f"- {rest['Name']} ({rest['Location']}): {rest['Cuisine']}, {rest['Award']}\n"
|
219 |
+
|
220 |
prefixed_message = (
|
221 |
f"{system_prefix} {system_message}\n\n"
|
222 |
+
f"[๊ด๋ จ ๋ฐ์ดํฐ]\n{most_similar_data}\n"
|
223 |
+
f"{restaurant_text}\n"
|
224 |
f"์ฌ์ฉ์ ์ง๋ฌธ: {user_message}"
|
225 |
)
|
226 |
else:
|
|
|
306 |
)
|
307 |
yield messages
|
308 |
|
|
|
309 |
def stream_gemini_response_special(user_message: str, messages: list) -> Iterator[list]:
|
310 |
"""
|
311 |
ํน์ ์ง๋ฌธ(์: ๊ฑด๊ฐ ์๋จ ์ค๊ณ, ๋ง์ถคํ ์๋ฆฌ ๊ฐ๋ฐ ๋ฑ)์ ๋ํ Gemini์ ์๊ฐ๊ณผ ๋ต๋ณ์ ์คํธ๋ฆฌ๋ฐ
|
|
|
343 |
"""
|
344 |
|
345 |
if most_similar_data:
|
346 |
+
# ๊ด๋ จ ๋ ์คํ ๋ ์ฐพ๊ธฐ
|
347 |
+
related_restaurants = find_related_restaurants(user_message)
|
348 |
+
restaurant_text = ""
|
349 |
+
if related_restaurants:
|
350 |
+
restaurant_text = "\n\n[๊ด๋ จ ๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ์ถ์ฒ]\n"
|
351 |
+
for rest in related_restaurants:
|
352 |
+
restaurant_text += f"- {rest['Name']} ({rest['Location']}): {rest['Cuisine']}, {rest['Award']}\n"
|
353 |
+
|
354 |
prefixed_message = (
|
355 |
f"{system_prefix} {system_message}\n\n"
|
356 |
+
f"[๊ด๋ จ ์ ๋ณด]\n{most_similar_data}\n"
|
357 |
+
f"{restaurant_text}\n"
|
358 |
f"์ฌ์ฉ์ ์ง๋ฌธ: {user_message}"
|
359 |
)
|
360 |
else:
|
|
|
478 |
"""
|
479 |
|
480 |
if most_similar_data:
|
481 |
+
# ๊ด๋ จ ๋ ์คํ ๋ ์ฐพ๊ธฐ
|
482 |
+
related_restaurants = find_related_restaurants(user_message)
|
483 |
+
restaurant_text = ""
|
484 |
+
if related_restaurants:
|
485 |
+
restaurant_text = "\n\n[๊ด๋ จ ๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ์ถ์ฒ]\n"
|
486 |
+
for rest in related_restaurants:
|
487 |
+
restaurant_text += f"- {rest['Name']} ({rest['Location']}): {rest['Cuisine']}, {rest['Award']}\n"
|
488 |
+
|
489 |
prefixed_message = (
|
490 |
f"{system_prefix} {system_message}\n\n"
|
491 |
+
f"[๊ด๋ จ ๋ฐ์ดํฐ]\n{most_similar_data}\n"
|
492 |
+
f"{restaurant_text}\n"
|
493 |
f"์ฌ์ฉ์ ์ง๋ฌธ: {user_message}"
|
494 |
)
|
495 |
else:
|
|
|
577 |
########################
|
578 |
# Gradio ์ธํฐํ์ด์ค ๊ตฌ์ฑ
|
579 |
########################
|
|
|
580 |
with gr.Blocks(
|
581 |
theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral"),
|
582 |
css="""
|
|
|
704 |
queue=False
|
705 |
)
|
706 |
|
707 |
+
# 3) ์ฌ์ฉ์ ๋ง์ถคํ ์์ ์ถ์ฒ ํญ
|
708 |
with gr.TabItem("์ฌ์ฉ์ ๋ง์ถคํ ์์ ์ถ์ฒ", id="personalized_cuisine_tab"):
|
709 |
personalized_chatbot = gr.Chatbot(
|
710 |
type="messages",
|
|
|
724 |
)
|
725 |
personalized_clear_button = gr.Button("๋ํ ์ด๊ธฐํ", scale=1)
|
726 |
|
|
|
727 |
personalized_example_prompts = [
|
728 |
["์๋ ๋ฅด๊ธฐ๊ฐ (๊ฒฌ๊ณผ๋ฅ, ํด์ฐ๋ฌผ)์ด๊ณ , ํ์ ์ฝ์ ๋ณต์ฉ ์ค์
๋๋ค. ์ ์นผ๋ก๋ฆฌ ์ ์ผ์ ์ถ์ฒ ๋ถํ๋๋ฆฝ๋๋ค."],
|
729 |
["์ ๋น๋ถ๋ด์ฆ์ด ์์ด์ ์ ์ ํ์ ํผํ๊ณ ์ถ๊ณ , ๋จ๋ฐฑ์ง ์ญ์ทจ๊ฐ ์ค์ํฉ๋๋ค. ์๋จ ์กฐํฉ ์ข ์๋ ค์ฃผ์ธ์."],
|
|
|
760 |
queue=False
|
761 |
)
|
762 |
|
763 |
+
# 4) ๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ํญ
|
764 |
+
with gr.TabItem("MICHELIN Restaurant", id="restaurant_tab"):
|
765 |
+
with gr.Row():
|
766 |
+
search_box = gr.Textbox(
|
767 |
+
label="๋ ์คํ ๋ ๊ฒ์",
|
768 |
+
placeholder="๋ ์คํ ๋ ์ด๋ฆ, ์ฃผ์, ์๋ฆฌ ์ข
๋ฅ ๋ฑ์ผ๋ก ๊ฒ์...",
|
769 |
+
scale=3
|
770 |
+
)
|
771 |
+
cuisine_dropdown = gr.Dropdown(
|
772 |
+
label="์๋ฆฌ ์ข
๋ฅ",
|
773 |
+
choices=[("์ ์ฒด", "์ ์ฒด")], # ์ด๊ธฐ๊ฐ ์ค์
|
774 |
+
value="์ ์ฒด",
|
775 |
+
scale=1
|
776 |
+
)
|
777 |
+
award_dropdown = gr.Dropdown(
|
778 |
+
label="๋ฏธ์๋ฆฐ ๋ฑ๊ธ",
|
779 |
+
choices=[("์ ์ฒด", "์ ์ฒด")], # ์ด๊ธฐ๊ฐ ์ค์
|
780 |
+
value="์ ์ฒด",
|
781 |
+
scale=1
|
782 |
+
)
|
783 |
+
search_button = gr.Button("๊ฒ์", scale=1)
|
784 |
+
|
785 |
+
result_table = gr.Dataframe(
|
786 |
+
headers=["Name", "Address", "Location", "Price", "Cuisine", "Award", "Description"],
|
787 |
+
row_count=100,
|
788 |
+
col_count=7,
|
789 |
+
interactive=False,
|
790 |
+
)
|
791 |
+
|
792 |
+
def init_dropdowns():
|
793 |
+
try:
|
794 |
+
with open('michelin_my_maps.csv', 'r', encoding='utf-8') as f:
|
795 |
+
reader = csv.DictReader(f)
|
796 |
+
restaurants = list(reader)
|
797 |
+
cuisines = [("์ ์ฒด", "์ ์ฒด")] + [(cuisine, cuisine) for cuisine in
|
798 |
+
sorted(set(r['Cuisine'] for r in restaurants if r['Cuisine']))]
|
799 |
+
awards = [("์ ์ฒด", "์ ์ฒด")] + [(award, award) for award in
|
800 |
+
sorted(set(r['Award'] for r in restaurants if r['Award']))]
|
801 |
+
return cuisines, awards
|
802 |
+
except FileNotFoundError:
|
803 |
+
print("Warning: michelin_my_maps.csv file not found")
|
804 |
+
return [("์ ์ฒด", "์ ์ฒด")], [("์ ์ฒด", "์ ์ฒด")]
|
805 |
+
|
806 |
+
def search_restaurants(search_term, cuisine, award):
|
807 |
+
try:
|
808 |
+
with open('michelin_my_maps.csv', 'r', encoding='utf-8') as f:
|
809 |
+
reader = csv.DictReader(f)
|
810 |
+
restaurants = list(reader)
|
811 |
+
|
812 |
+
filtered = []
|
813 |
+
search_term = search_term.lower() if search_term else ""
|
814 |
+
|
815 |
+
for r in restaurants:
|
816 |
+
if search_term == "" or \
|
817 |
+
search_term in r['Name'].lower() or \
|
818 |
+
search_term in r['Address'].lower() or \
|
819 |
+
search_term in r['Description'].lower():
|
820 |
+
if (cuisine == "์ ์ฒด" or r['Cuisine'] == cuisine) and \
|
821 |
+
(award == "์ ์ฒด" or r['Award'] == award):
|
822 |
+
filtered.append([
|
823 |
+
r['Name'], r['Address'], r['Location'],
|
824 |
+
r['Price'], r['Cuisine'], r['Award'],
|
825 |
+
r['Description']
|
826 |
+
])
|
827 |
+
if len(filtered) >= 100: # ์ต๋ 10๊ฐ ๊ฒฐ๊ณผ๋ก ์ ํ
|
828 |
+
break
|
829 |
+
|
830 |
+
return filtered
|
831 |
+
except FileNotFoundError:
|
832 |
+
return [["ํ์ผ์ ์ฐพ์ ์ ์์ต๋๋ค", "", "", "", "", "", "michelin_my_maps.csv ํ์ผ์ ํ์ธํด์ฃผ์ธ์"]]
|
833 |
+
|
834 |
+
# ๋๋กญ๋ค์ด ์ด๊ธฐํ
|
835 |
+
cuisines, awards = init_dropdowns()
|
836 |
+
cuisine_dropdown.choices = cuisines
|
837 |
+
award_dropdown.choices = awards
|
838 |
+
|
839 |
+
search_button.click(
|
840 |
+
search_restaurants,
|
841 |
+
inputs=[search_box, cuisine_dropdown, award_dropdown],
|
842 |
+
outputs=result_table
|
843 |
+
)
|
844 |
+
|
845 |
+
|
846 |
+
|
847 |
+
|
848 |
# ์ฌ์ฉ ๊ฐ์ด๋ ํญ
|
849 |
with gr.TabItem("์ด์ฉ ๋ฐฉ๋ฒ", id="instructions_tab"):
|
850 |
gr.Markdown(
|
|
|
861 |
- **ํ๊ตญ ์์ ํนํ**: ์ ํต ํ์ ๋ ์ํผ ๋ฐ ํ๊ตญ ์์ ๋ฐ์ดํฐ๋ฅผ ํตํด ๋ณด๋ค ํ๋ถํ ์ ์ ๊ฐ๋ฅ.
|
862 |
- **์ค์๊ฐ ์ถ๋ก (Thinking) ํ์**: ๋ต๋ณ ๊ณผ์ ์์ ๋ชจ๋ธ์ด ์๊ฐ์ ์ ๊ฐํ๋ ํ๋ฆ(์คํ์ ๊ธฐ๋ฅ)์ ๋ถ๋ถ์ ์ผ๋ก ํ์ธ.
|
863 |
- **๋ฐ์ดํฐ ๊ฒ์**: ๋ด๋ถ์ ์ผ๋ก ์ ํฉํ ์ ๋ณด๋ฅผ ์ฐพ์ ์ฌ์ฉ์ ์ง๋ฌธ์ ๋ํ ๋ต์ ํ๋ถํ๊ฒ ์ ๊ณต.
|
864 |
+
- **๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ๊ฒ์**: ์ ์ธ๊ณ ๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ๊ฒ์ ๋ฐ ํํฐ๋ง ๊ธฐ๋ฅ ์ ๊ณต.
|
865 |
|
866 |
### ์ฌ์ฉ ๋ฐฉ๋ฒ
|
867 |
1. **'์ฐฝ์์ ๋ ์ํผ ๋ฐ ๊ฐ์ด๋' ํญ**: ์ผ๋ฐ์ ์ธ ์๋ฆฌ ์์ด๋์ด๋ ์์ ์ ๋ณด๋ฅผ ๋ฌธ์.
|
868 |
2. **'๋ง์ถคํ ์๋จ/๊ฑด๊ฐ' ํญ**: ํน์ ์งํ, ์ํฉ๋ณ(์คํฌ์ธ , ๋ค์ด์ดํธ ๋ฑ) ์๋จ/๋ ์ํผ ์๋ด.
|
869 |
3. **'์ฌ์ฉ์ ๋ง์ถคํ ์์ ์ถ์ฒ' ํญ**: ์๋ ๋ฅด๊ธฐ, ์ฝ๋ฌผ, ๊ฐ์ธ ์นผ๋ก๋ฆฌ ๋ชฉํ ๋ฑ ์ธ๋ถ ์กฐ๊ฑด์ ๊ณ ๋ คํ ์ต์ ์๋จ ์ถ์ฒ.
|
870 |
+
4. **'MICHELIN Restaurant' ํญ**: ๋ฏธ์๋ฆฐ ๋ ์คํ ๋ ๊ฒ์ ๋ฐ ์์ธ ์ ๋ณด ํ์ธ.
|
871 |
+
5. **์์ ์ง๋ฌธ**์ ํด๋ฆญํ๋ฉด ์ฆ์ ์ง๋ฌธ์ผ๋ก ๋ถ๋ฌ์ต๋๋ค.
|
872 |
+
6. ํ์ ์ **๋ํ ์ด๊ธฐํ** ๋ฒํผ์ ๋๋ฌ ์ ๋ํ๋ฅผ ์์ํ์ธ์.
|
873 |
|
874 |
### ์ฐธ๊ณ ์ฌํญ
|
875 |
- **Thinking(์ถ๋ก ) ๊ธฐ๋ฅ**์ ๋ชจ๋ธ ๋ด๋ถ ๊ณผ์ ์ ์ผ๋ถ ๊ณต๊ฐํ์ง๋ง, ์ด๋ ์คํ์ ์ด๋ฉฐ ์ค์ ์๋น์ค์์๋ ๋น๊ณต๊ฐ๋ ์ ์์ต๋๋ค.
|
|
|
880 |
|
881 |
# Gradio ์น ์๋น์ค ์คํ
|
882 |
if __name__ == "__main__":
|
883 |
+
demo.launch(debug=True)
|