Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -448,296 +448,5 @@ with gr.Blocks(title="ํค์๋ ๊ธฐ๋ฐ ์ฐฝ์์ ๋ณํ ์์ด๋์ด ์์ฑ๊ธฐ",
|
|
448 |
outputs=processing_indicator
|
449 |
)
|
450 |
|
451 |
-
if __name__ == "__main__":
|
452 |
-
demo.launch(debug=True)
|
453 |
-
|
454 |
-
],
|
455 |
-
|
456 |
-
"ํ๊ฒฝ ์ํธ์์ฉ": [
|
457 |
-
"์จ๋ ๋ฐ์", "์ต๋ ๋ฐ์", "๊ธฐ์ ๋ฐ์", "์ค๋ ฅ ๋ฐ์", "์๊ธฐ์ฅ ๋ฐ์",
|
458 |
-
"๋น ๋ฐ์", "์๋ฆฌ ๋ฐ์", "ํํ ๋ฌผ์ง ๊ฐ์ง", "๊ธฐ๊ณ์ ์๊ทน ๊ฐ์ง", "์ ๊ธฐ ์๊ทน ๋ฐ์",
|
459 |
-
"๋ฐฉ์ฌ์ ๋ฐ์", "์ง๋ ๊ฐ์ง", "pH ๋ฐ์", "์ฉ๋งค ๋ฐ์", "๊ธฐ์ฒด ๊ตํ",
|
460 |
-
"ํ๊ฒฝ ์ค์ผ ๋ฐ์", "๋ ์จ ๋ฐ์", "๊ณ์ ๋ณํ ๋ฐ์", "์ผ์ฃผ๊ธฐ ๋ฐ์", "์ํ๊ณ ์ํธ์์ฉ",
|
461 |
-
"๊ณต์/๊ฒฝ์ ๋ฐ์", "ํฌ์/ํผ์ ๊ด๊ณ", "๊ตฐ์ง ํ์ฑ", "์์ญ ์ค์ ", "์ด์ฃผ/์ ์ฐฉ ํจํด"
|
462 |
-
],
|
463 |
-
|
464 |
-
"์ผ์ ๊ธฐ๋ฅ": [
|
465 |
-
"์๊ฐ ์ผ์/๊ฐ์ง", "์ฒญ๊ฐ ์ผ์/๊ฐ์ง", "์ด๊ฐ ์ผ์/๊ฐ์ง", "๋ฏธ๊ฐ ์ผ์/๊ฐ์ง", "ํ๊ฐ ์ผ์/๊ฐ์ง",
|
466 |
-
"์จ๋ ์ผ์/๊ฐ์ง", "์ต๋ ์ผ์/๊ฐ์ง", "์๋ ฅ ์ผ์/๊ฐ์ง", "๊ฐ์๋ ์ผ์/๊ฐ์ง", "ํ์ ์ผ์/๊ฐ์ง",
|
467 |
-
"๊ทผ์ ์ผ์/๊ฐ์ง", "์์น ์ผ์/๊ฐ์ง", "์ด๋ ์ผ์/๊ฐ์ง", "๊ฐ์ค ์ผ์/๊ฐ์ง", "์ ์ธ์ ์ผ์/๊ฐ์ง",
|
468 |
-
"์์ธ์ ์ผ์/๊ฐ์ง", "๋ฐฉ์ฌ์ ์ผ์/๊ฐ์ง", "์๊ธฐ์ฅ ์ผ์/๊ฐ์ง", "์ ๊ธฐ์ฅ ์ผ์/๊ฐ์ง", "ํํ๋ฌผ์ง ์ผ์/๊ฐ์ง",
|
469 |
-
"์์ฒด์ ํธ ์ผ์/๊ฐ์ง", "์ง๋ ์ผ์/๊ฐ์ง", "์์ ์ผ์/๊ฐ์ง", "๋น ์ธ๊ธฐ ์ผ์/๊ฐ์ง", "๋น ํ์ฅ ์ผ์/๊ฐ์ง",
|
470 |
-
"๊ธฐ์ธ๊ธฐ ์ผ์/๊ฐ์ง", "pH ์ผ์/๊ฐ์ง", "์ ๋ฅ ์ผ์/๊ฐ์ง", "์ ์ ์ผ์/๊ฐ์ง", "์ด๋ฏธ์ง ์ผ์/๊ฐ์ง",
|
471 |
-
"๊ฑฐ๋ฆฌ ์ผ์/๊ฐ์ง", "๊น์ด ์ผ์/๊ฐ์ง", "์ค๋ ฅ ์ผ์/๊ฐ์ง", "์๋ ์ผ์/๊ฐ์ง", "ํ๋ฆ ์ผ์/๊ฐ์ง",
|
472 |
-
"์์ ์ผ์/๊ฐ์ง", "ํ๋ ์ผ์/๊ฐ์ง", "์ผ๋ ์ผ์/๊ฐ์ง", "๊ธ์ ๊ฐ์ง", "์์ ์ผ์/๊ฐ์ง",
|
473 |
-
"๊ด์ ์ผ์/๊ฐ์ง", "์ด์ ๋ ์ผ์/๊ฐ์ง", "ํ ํจ๊ณผ ์ผ์/๊ฐ์ง", "์ด์ํ ์ผ์/๊ฐ์ง", "๋ ์ด๋ ์ผ์/๊ฐ์ง",
|
474 |
-
"๋ผ์ด๋ค ์ผ์/๊ฐ์ง", "ํฐ์น ์ผ์/๊ฐ์ง", "์ ์ค์ฒ ์ผ์/๊ฐ์ง", "์ฌ๋ฐ ์ผ์/๊ฐ์ง", "ํ์ ์ผ์/๊ฐ์ง"
|
475 |
-
]
|
476 |
-
}
|
477 |
-
|
478 |
-
##############################################################################
|
479 |
-
# Gemini API ํธ์ถ ํจ์ (์: gemini-2.0-flash-thinking-exp-01-21 -> ๋ค๋ฅธ ๋ชจ๋ธ ์ฌ์ฉ ์ ์์ )
|
480 |
-
##############################################################################
|
481 |
-
def query_gemini_api(prompt):
|
482 |
-
try:
|
483 |
-
# ์์: ๊ธฐ์กด gemini-2.0... ๋์ , ๋ค๋ฅธ ๋ชจ๋ธ์ด ํ์ํ๋ค๋ฉด ๊ต์ฒดํ์ธ์.
|
484 |
-
model = genai.GenerativeModel('gemini-2.0-flash-thinking-exp-01-21')
|
485 |
-
|
486 |
-
response = model.generate_content(prompt)
|
487 |
-
|
488 |
-
# ์๋ต ๊ตฌ์กฐ ๋ฐฉ์ด์ ์ผ๋ก ์ฒ๋ฆฌ
|
489 |
-
try:
|
490 |
-
if hasattr(response, 'text'):
|
491 |
-
return response.text
|
492 |
-
|
493 |
-
if hasattr(response, 'candidates') and response.candidates:
|
494 |
-
if len(response.candidates) > 0:
|
495 |
-
candidate = response.candidates[0]
|
496 |
-
if hasattr(candidate, 'content'):
|
497 |
-
content = candidate.content
|
498 |
-
if hasattr(content, 'parts') and content.parts:
|
499 |
-
if len(content.parts) > 0:
|
500 |
-
return content.parts[0].text
|
501 |
-
if hasattr(response, 'parts') and response.parts:
|
502 |
-
if len(response.parts) > 0:
|
503 |
-
return response.parts[0].text
|
504 |
-
|
505 |
-
return "Unable to generate a response. API response structure is different than expected."
|
506 |
-
|
507 |
-
except Exception as inner_e:
|
508 |
-
logger.error(f"Error processing response: {inner_e}")
|
509 |
-
return f"An error occurred while processing the response: {str(inner_e)}"
|
510 |
-
|
511 |
-
except Exception as e:
|
512 |
-
logger.error(f"Error calling Gemini API: {e}")
|
513 |
-
if "API key not valid" in str(e):
|
514 |
-
return "API key is not valid. Please check your GEMINI_API_KEY environment variable."
|
515 |
-
return f"An error occurred while calling the API: {str(e)}"
|
516 |
-
|
517 |
-
##############################################################################
|
518 |
-
# ์ค๋ช
ํ์ฅ ํจ์: "๋ชจ๋ธ/์ปจ์
/ํ์์ ๋ณํ์ ๋ํ ์ดํด์ ํ์ ํฌ์ธํธ, ๊ธฐ๋ฅ์ฑ ๋ฑ์ ์ค์ฌ"์ผ๋ก
|
519 |
-
##############################################################################
|
520 |
-
def enhance_with_llm(base_description, obj_name, category):
|
521 |
-
prompt = f"""
|
522 |
-
๋ค์์ '{obj_name}'์ '{category}' ๊ด๋ จ ๊ฐ๋จํ ์ค๋ช
์
๋๋ค:
|
523 |
-
"{base_description}"
|
524 |
-
์ ๋ด์ฉ์ ๋ณด๋ค ๊ตฌ์ฒดํํ์ฌ,
|
525 |
-
1) ์ฐฝ์์ ์ธ ๋ชจ๋ธ/์ปจ์
/ํ์์ ๋ณํ์ ๋ํ ์ดํด,
|
526 |
-
2) ํ์ ํฌ์ธํธ์ ๊ธฐ๋ฅ์ฑ ๋ฑ์ ์ค์ฌ์ผ๋ก
|
527 |
-
3~4๋ฌธ์ฅ์ ์์ด๋์ด๋ก ํ์ฅํด ์ฃผ์ธ์.
|
528 |
-
"""
|
529 |
-
return query_gemini_api(prompt)
|
530 |
-
|
531 |
-
##############################################################################
|
532 |
-
# ๋จ์ผ ํค์๋(์ค๋ธ์ ํธ)์ ๋ํ "์ฐฝ์์ ๋ณํ ์์ด๋์ด" ์์ฑ
|
533 |
-
##############################################################################
|
534 |
-
def generate_single_object_transformations(obj):
|
535 |
-
results = {}
|
536 |
-
for category, transformations in physical_transformation_categories.items():
|
537 |
-
transformation = choose_alternative(random.choice(transformations))
|
538 |
-
base_description = f"{obj}์ด(๊ฐ) {transformation} ํ์์ ๋ณด์ธ๋ค"
|
539 |
-
results[category] = {"base": base_description, "enhanced": None}
|
540 |
-
return results
|
541 |
-
|
542 |
-
##############################################################################
|
543 |
-
# ๋ ํค์๋์ ๋ํ "์ฐฝ์์ ๋ณํ ์์ด๋์ด" ์์ฑ
|
544 |
-
##############################################################################
|
545 |
-
def generate_two_objects_interaction(obj1, obj2):
|
546 |
-
results = {}
|
547 |
-
for category, transformations in physical_transformation_categories.items():
|
548 |
-
transformation = choose_alternative(random.choice(transformations))
|
549 |
-
template = random.choice([
|
550 |
-
"{obj1}์ด(๊ฐ) {obj2}์ ๊ฒฐํฉํ์ฌ {change}๊ฐ ๋ฐ์ํ๋ค",
|
551 |
-
"{obj1}๊ณผ(์) {obj2}์ด(๊ฐ) ์ถฉ๋ํ๋ฉด์ {change}๊ฐ ์ผ์ด๋ฌ๋ค"
|
552 |
-
])
|
553 |
-
base_description = template.format(obj1=obj1, obj2=obj2, change=transformation)
|
554 |
-
results[category] = {"base": base_description, "enhanced": None}
|
555 |
-
return results
|
556 |
-
|
557 |
-
##############################################################################
|
558 |
-
# ์ธ ํค์๋์ ๋ํ "์ฐฝ์์ ๋ณํ ์์ด๋์ด" ์์ฑ
|
559 |
-
##############################################################################
|
560 |
-
def generate_three_objects_interaction(obj1, obj2, obj3):
|
561 |
-
results = {}
|
562 |
-
for category, transformations in physical_transformation_categories.items():
|
563 |
-
transformation = choose_alternative(random.choice(transformations))
|
564 |
-
template = random.choice([
|
565 |
-
"{obj1}, {obj2}, {obj3}์ด(๊ฐ) ์ผ๊ฐํ ๊ตฌ์กฐ๋ก ๊ฒฐํฉํ์ฌ {change}๊ฐ ๋ฐ์ํ๋ค",
|
566 |
-
"{obj1}์ด(๊ฐ) {obj2}์(๊ณผ) {obj3} ์ฌ์ด์์ ๋งค๊ฐ์ฒด ์ญํ ์ ํ๋ฉฐ {change}๋ฅผ ์ด์งํ๋ค"
|
567 |
-
])
|
568 |
-
base_description = template.format(obj1=obj1, obj2=obj2, obj3=obj3, change=transformation)
|
569 |
-
results[category] = {"base": base_description, "enhanced": None}
|
570 |
-
return results
|
571 |
-
|
572 |
-
##############################################################################
|
573 |
-
# ์์ฑ๋ ๊ธฐ๋ณธ ์ค๋ช
์ LLM์ ํตํด ํ์ฅ
|
574 |
-
##############################################################################
|
575 |
-
def enhance_descriptions(results, objects):
|
576 |
-
obj_name = " ๋ฐ ".join([obj for obj in objects if obj])
|
577 |
-
|
578 |
-
for category, result in results.items():
|
579 |
-
result["enhanced"] = enhance_with_llm(result["base"], obj_name, category)
|
580 |
-
|
581 |
-
return results
|
582 |
-
|
583 |
-
##############################################################################
|
584 |
-
# ์ฌ์ฉ์ ์
๋ ฅ(์ต๋ 3๊ฐ ํค์๋)์ ๋ฐ๋ผ ์ฐฝ์์ ๋ณํ ์์ด๋์ด ์์ฑ
|
585 |
-
##############################################################################
|
586 |
-
def generate_transformations(text1, text2=None, text3=None):
|
587 |
-
if text2 and text3:
|
588 |
-
results = generate_three_objects_interaction(text1, text2, text3)
|
589 |
-
objects = [text1, text2, text3]
|
590 |
-
elif text2:
|
591 |
-
results = generate_two_objects_interaction(text1, text2)
|
592 |
-
objects = [text1, text2]
|
593 |
-
else:
|
594 |
-
results = generate_single_object_transformations(text1)
|
595 |
-
objects = [text1]
|
596 |
-
|
597 |
-
return enhance_descriptions(results, objects)
|
598 |
-
|
599 |
-
##############################################################################
|
600 |
-
# ๊ฒฐ๊ณผ ํฌ๋งทํ
|
601 |
-
##############################################################################
|
602 |
-
def format_results(results):
|
603 |
-
formatted = ""
|
604 |
-
for category, result in results.items():
|
605 |
-
formatted += f"## {category}\n**๊ธฐ๋ณธ ์์ด๋์ด**: {result['base']}\n\n**ํ์ฅ๋ ์์ด๋์ด**: {result['enhanced']}\n\n---\n\n"
|
606 |
-
return formatted
|
607 |
-
|
608 |
-
##############################################################################
|
609 |
-
# Gradio UI์์ ํธ์ถํ ํจ์
|
610 |
-
##############################################################################
|
611 |
-
def process_inputs(text1, text2, text3, selected_category, progress=gr.Progress()):
|
612 |
-
text1 = text1.strip() if text1 else None
|
613 |
-
text2 = text2.strip() if text2 else None
|
614 |
-
text3 = text3.strip() if text3 else None
|
615 |
-
|
616 |
-
if not text1:
|
617 |
-
return "์ค๋ฅ: ์ต์ ํ๋์ ํค์๋๋ฅผ ์
๋ ฅํด์ฃผ์ธ์."
|
618 |
-
|
619 |
-
keyword_info = f"ํค์๋: {text1}"
|
620 |
-
if text2:
|
621 |
-
keyword_info += f", {text2}"
|
622 |
-
if text3:
|
623 |
-
keyword_info += f", {text3}"
|
624 |
-
|
625 |
-
progress(0.05, desc="์์ด๋์ด ์์ฑ ์ค๋น ์ค...")
|
626 |
-
time.sleep(0.3) # ์๊ฐ์ ํจ๊ณผ๋ฅผ ์ํ ์งง์ ์ง์ฐ
|
627 |
-
|
628 |
-
progress(0.1, desc="์ฐฝ์์ ์ธ ๋ชจ๋ธ/์ปจ์
/ํ์ ๋ณํ ์์ด๋์ด ์์ฑ ์์...")
|
629 |
-
|
630 |
-
results = generate_transformations(text1, text2, text3)
|
631 |
-
|
632 |
-
# ์ ํํ ์นดํ
๊ณ ๋ฆฌ์ ํด๋นํ๋ ๊ฒฐ๊ณผ๋ง ํํฐ๋ง
|
633 |
-
if selected_category in results:
|
634 |
-
results = {selected_category: results[selected_category]}
|
635 |
-
else:
|
636 |
-
return "์ ํํ ์นดํ
๊ณ ๋ฆฌ๊ฐ ๊ฒฐ๊ณผ์ ์กด์ฌํ์ง ์์ต๋๋ค."
|
637 |
-
|
638 |
-
progress(0.8, desc="๊ฒฐ๊ณผ ํฌ๋งทํ
์ค...")
|
639 |
-
formatted = format_results(results)
|
640 |
-
|
641 |
-
progress(1.0, desc="์๋ฃ!")
|
642 |
-
return formatted
|
643 |
-
|
644 |
-
##############################################################################
|
645 |
-
# API ํค ๊ฒฝ๊ณ ๋ฉ์์ง
|
646 |
-
##############################################################################
|
647 |
-
def get_warning_message():
|
648 |
-
if not GEMINI_API_KEY:
|
649 |
-
return "โ ๏ธ ํ๊ฒฝ ๋ณ์ GEMINI_API_KEY๊ฐ ์ค์ ๋์ง ์์์ต๋๋ค. Gemini API ํค๋ฅผ ์ค์ ํ์ธ์."
|
650 |
-
return ""
|
651 |
-
|
652 |
-
##############################################################################
|
653 |
-
# Gradio UI
|
654 |
-
##############################################################################
|
655 |
-
with gr.Blocks(title="ํค์๋ ๊ธฐ๋ฐ ์ฐฝ์์ ๋ณํ ์์ด๋์ด ์์ฑ๊ธฐ",
|
656 |
-
theme=gr.themes.Soft(primary_hue="teal", secondary_hue="slate", neutral_hue="neutral")) as demo:
|
657 |
-
|
658 |
-
gr.HTML("""
|
659 |
-
<style>
|
660 |
-
body { background: linear-gradient(135deg, #e0eafc, #cfdef3); font-family: 'Arial', sans-serif; }
|
661 |
-
.gradio-container { padding: 20px; }
|
662 |
-
h1, h2 { text-align: center; }
|
663 |
-
h1 { color: #333; }
|
664 |
-
h2 { color: #555; }
|
665 |
-
.output { background-color: #ffffff; padding: 15px; border-radius: 8px; }
|
666 |
-
.gr-button { background-color: #4CAF50; color: white; border: none; border-radius: 4px; padding: 8px 16px; }
|
667 |
-
.progress-message { color: #2196F3; font-weight: bold; margin-top: 10px; }
|
668 |
-
</style>
|
669 |
-
""")
|
670 |
-
|
671 |
-
gr.Markdown("# ๐ ํค์๋ ๊ธฐ๋ฐ ์ฐฝ์์ ๋ณํ ์์ด๋์ด ์์ฑ๊ธฐ")
|
672 |
-
gr.Markdown("์
๋ ฅํ **ํค์๋**(์ต๋ 3๊ฐ)์ **์นดํ
๊ณ ๋ฆฌ**๋ฅผ ๋ฐํ์ผ๋ก, **์ฐฝ์์ ์ธ ๋ชจ๋ธ/์ปจ์
/ํ์ ๋ณํ**์ ๋ํ ์ดํด์ **ํ์ ํฌ์ธํธ**, **๊ธฐ๋ฅ์ฑ** ๋ฑ์ ์ค์ฌ์ผ๋ก ํ์ฅ๋ ์์ด๋์ด๋ฅผ ์ ์ํฉ๋๋ค.")
|
673 |
-
|
674 |
-
warning = gr.Markdown(get_warning_message())
|
675 |
-
|
676 |
-
# ์ข์ธก ์
๋ ฅ ์์ญ
|
677 |
-
with gr.Row():
|
678 |
-
with gr.Column(scale=1):
|
679 |
-
text_input1 = gr.Textbox(label="ํค์๋ 1 (ํ์)", placeholder="์: ์ค๋งํธํฐ")
|
680 |
-
text_input2 = gr.Textbox(label="ํค์๋ 2 (์ ํ)", placeholder="์: ์ธ๊ณต์ง๋ฅ")
|
681 |
-
text_input3 = gr.Textbox(label="ํค์๋ 3 (์ ํ)", placeholder="์: ํฌ์ค์ผ์ด")
|
682 |
-
# ์นดํ
๊ณ ๋ฆฌ ์ ํ ๋๋กญ๋ค์ด ์ถ๊ฐ
|
683 |
-
category_dropdown = gr.Dropdown(
|
684 |
-
label="์นดํ
๊ณ ๋ฆฌ ์ ํ",
|
685 |
-
choices=list(physical_transformation_categories.keys()),
|
686 |
-
value=list(physical_transformation_categories.keys())[0],
|
687 |
-
info="์ถ๋ ฅํ ์นดํ
๊ณ ๋ฆฌ๋ฅผ ์ ํํ์ธ์."
|
688 |
-
)
|
689 |
-
|
690 |
-
status_msg = gr.Markdown("๐ก '์์ด๋์ด ์์ฑํ๊ธฐ' ๋ฒํผ์ ํด๋ฆญํ๋ฉด ์์ด๋์ด ์์ฑ์ด ์์๋ฉ๋๋ค.")
|
691 |
-
|
692 |
-
processing_indicator = gr.HTML("""
|
693 |
-
<div style="display: flex; justify-content: center; align-items: center; margin: 10px 0;">
|
694 |
-
<div style="border: 5px solid #f3f3f3; border-top: 5px solid #3498db; border-radius: 50%; width: 30px; height: 30px; animation: spin 2s linear infinite;"></div>
|
695 |
-
<p style="margin-left: 10px; font-weight: bold; color: #3498db;">์ฒ๋ฆฌ ์ค์
๋๋ค...</p>
|
696 |
-
</div>
|
697 |
-
<style>
|
698 |
-
@keyframes spin {
|
699 |
-
0% { transform: rotate(0deg); }
|
700 |
-
100% { transform: rotate(360deg); }
|
701 |
-
}
|
702 |
-
</style>
|
703 |
-
""", visible=False)
|
704 |
-
|
705 |
-
submit_button = gr.Button("์์ด๋์ด ์์ฑํ๊ธฐ", variant="primary")
|
706 |
-
|
707 |
-
# ์ฐ์ธก ์ถ๋ ฅ ์์ญ
|
708 |
-
with gr.Column(scale=2):
|
709 |
-
idea_output = gr.Markdown(label="์์ด๋์ด ๊ฒฐ๊ณผ")
|
710 |
-
|
711 |
-
gr.Examples(
|
712 |
-
examples=[
|
713 |
-
["์ค๋งํธํฐ", "", "", list(physical_transformation_categories.keys())[0]],
|
714 |
-
["์๋์ฐจ", "", "", list(physical_transformation_categories.keys())[0]],
|
715 |
-
["์๋์ฐจ", "์ธ๊ณต์ง๋ฅ", "", list(physical_transformation_categories.keys())[0]],
|
716 |
-
["๋๋ก ", "์ธ๊ณต์ง๋ฅ", "", list(physical_transformation_categories.keys())[0]],
|
717 |
-
["์ด๋ํ", "์จ์ด๋ฌ๋ธ", "๊ฑด๊ฐ", list(physical_transformation_categories.keys())[0]],
|
718 |
-
],
|
719 |
-
inputs=[text_input1, text_input2, text_input3, category_dropdown],
|
720 |
-
)
|
721 |
-
|
722 |
-
def show_processing_indicator():
|
723 |
-
return gr.update(visible=True)
|
724 |
-
|
725 |
-
def hide_processing_indicator():
|
726 |
-
return gr.update(visible=False)
|
727 |
-
|
728 |
-
submit_button.click(
|
729 |
-
fn=show_processing_indicator,
|
730 |
-
inputs=None,
|
731 |
-
outputs=processing_indicator
|
732 |
-
).then(
|
733 |
-
fn=process_inputs,
|
734 |
-
inputs=[text_input1, text_input2, text_input3, category_dropdown],
|
735 |
-
outputs=idea_output
|
736 |
-
).then(
|
737 |
-
fn=hide_processing_indicator,
|
738 |
-
inputs=None,
|
739 |
-
outputs=processing_indicator
|
740 |
-
)
|
741 |
-
|
742 |
if __name__ == "__main__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