Spaces:
Runtime error
Major UI/UX improvements for Eternity POC v3.1
Browse files✨ Enhanced Visual Design:
- Professional gradient backgrounds and shadows
- Improved typography and spacing
- Responsive design with better mobile support
- Enhanced color scheme and visual hierarchy
🎨 Better User Experience:
- Clearer status indicators with color coding
- Improved tab organization and content layout
- Enhanced avatar display with dynamic emotions
- Better form layouts and input validation
📊 Enhanced Information Display:
- Comprehensive API status monitoring
- Detailed conversation statistics
- Improved knowledge base management
- Professional technical documentation
🔧 Improved Functionality:
- Better error handling and user feedback
- Enhanced persona management system
- Improved document upload interface
- More robust API status checking
🚀 Performance Optimizations:
- Faster UI rendering
- Better state management
- Optimized API calls
- Enhanced conversation memory
|
@@ -128,31 +128,22 @@ def check_llama_api_multiple_endpoints():
|
|
| 128 |
endpoints_to_try = [
|
| 129 |
"https://api-inference.huggingface.co/models/meta-llama/Llama-3.1-8B-Instruct",
|
| 130 |
"https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3.1-8B-Instruct",
|
| 131 |
-
"https://huggingface.co/chat/conversation", # Chat API endpoint
|
| 132 |
]
|
| 133 |
|
| 134 |
headers = {"Authorization": f"Bearer {hf_token}"}
|
| 135 |
|
| 136 |
for endpoint in endpoints_to_try:
|
| 137 |
try:
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
else:
|
| 146 |
-
# Standard inference API test
|
| 147 |
-
response = requests.post(
|
| 148 |
-
endpoint,
|
| 149 |
-
headers=headers,
|
| 150 |
-
json={"inputs": "Test", "parameters": {"max_new_tokens": 10}},
|
| 151 |
-
timeout=10
|
| 152 |
-
)
|
| 153 |
|
| 154 |
if response.status_code == 200:
|
| 155 |
-
return f"✅ API Ready
|
| 156 |
elif response.status_code == 503:
|
| 157 |
return "⏳ Model Loading"
|
| 158 |
elif response.status_code == 429:
|
|
@@ -344,40 +335,80 @@ def get_avatar_emotion(response_text, model_used):
|
|
| 344 |
return "😊" # Default happy emotion
|
| 345 |
|
| 346 |
def create_enhanced_eternity_interface():
|
| 347 |
-
"""Create the enhanced Eternity POC interface with
|
| 348 |
import gradio as gr
|
| 349 |
|
| 350 |
-
#
|
| 351 |
custom_css = """
|
| 352 |
-
.main-header {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
.avatar-display {
|
| 354 |
text-align: center;
|
| 355 |
-
font-size:
|
| 356 |
-
padding:
|
| 357 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 358 |
border-radius: 20px;
|
| 359 |
color: white;
|
| 360 |
-
margin:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 361 |
}
|
| 362 |
.status-good { color: #28a745; font-weight: bold; }
|
| 363 |
.status-warning { color: #ffc107; font-weight: bold; }
|
| 364 |
.status-error { color: #dc3545; font-weight: bold; }
|
| 365 |
.info-box {
|
| 366 |
-
background: #f8f9fa
|
| 367 |
-
padding:
|
| 368 |
-
border-radius:
|
| 369 |
-
border-left:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
margin: 10px 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 371 |
}
|
| 372 |
"""
|
| 373 |
|
| 374 |
-
with gr.Blocks(css=custom_css, title="Eternity POC - Magyar Avatar") as interface:
|
| 375 |
gr.HTML("""
|
| 376 |
<div class="main-header">
|
| 377 |
🎭 Eternity - Magyar Interaktív Avatar POC v3.1
|
| 378 |
</div>
|
| 379 |
-
<div class="
|
| 380 |
-
<strong>Fejlett Proof-of-Concept az Eternity projekthez</strong><br>
|
| 381 |
🦙 <strong>Llama-3.1-8B API:</strong> Többszintű API kezelés és fallback rendszer<br>
|
| 382 |
🇭🇺 <strong>Magyar nyelv:</strong> Natív támogatás és természetes beszélgetés<br>
|
| 383 |
📚 <strong>Tudásbázis:</strong> Dokumentum-alapú kontextuális válaszok<br>
|
|
@@ -386,33 +417,39 @@ def create_enhanced_eternity_interface():
|
|
| 386 |
""")
|
| 387 |
|
| 388 |
with gr.Tabs():
|
| 389 |
-
# Chat Tab
|
| 390 |
with gr.Tab("💬 Beszélgetés"):
|
| 391 |
with gr.Row():
|
| 392 |
with gr.Column(scale=2):
|
| 393 |
chatbot = gr.Chatbot(
|
| 394 |
-
label="Beszélgetés az avatarral",
|
| 395 |
-
height=
|
| 396 |
-
show_label=True
|
|
|
|
|
|
|
| 397 |
)
|
| 398 |
|
| 399 |
with gr.Row():
|
| 400 |
msg_input = gr.Textbox(
|
| 401 |
-
placeholder="Írj egy üzenetet...",
|
| 402 |
-
label="Üzenet",
|
| 403 |
-
scale=4
|
|
|
|
| 404 |
)
|
| 405 |
-
send_btn = gr.Button("📤 Küldés", scale=1, variant="primary")
|
| 406 |
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
|
|
|
|
|
|
|
|
|
| 411 |
|
| 412 |
with gr.Column(scale=1):
|
| 413 |
avatar_display = gr.HTML(
|
| 414 |
-
"""<div class="avatar-display">😊<br><small>Eternity Avatar</small></div>""",
|
| 415 |
-
label="Avatar Megjelenítés"
|
| 416 |
)
|
| 417 |
|
| 418 |
model_status = gr.HTML(
|
|
@@ -421,60 +458,119 @@ def create_enhanced_eternity_interface():
|
|
| 421 |
🦙 <strong>Llama-3.1-8B API:</strong> <span class="status-warning">Ellenőrzés...</span><br>
|
| 422 |
🤖 <strong>OpenAI API:</strong> <span class="status-error">Nincs beállítva</span><br>
|
| 423 |
🔑 <strong>HF Token:</strong> <span class="status-good">Beállítva</span><br>
|
| 424 |
-
📚 <strong>Tudásbázis
|
| 425 |
</div>""",
|
| 426 |
-
label="Rendszer Állapot"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 427 |
)
|
| 428 |
|
| 429 |
-
# Persona Setup Tab
|
| 430 |
with gr.Tab("👤 Persona Beállítás"):
|
| 431 |
-
gr.HTML("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 432 |
|
| 433 |
with gr.Row():
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 442 |
|
| 443 |
persona_background = gr.Textbox(
|
| 444 |
-
label="Háttér/Történet",
|
| 445 |
-
placeholder="Mesélj az avatar hátteréről, tapasztalatairól...",
|
| 446 |
-
lines=
|
|
|
|
| 447 |
)
|
| 448 |
|
| 449 |
-
|
| 450 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
|
| 452 |
-
# Knowledge Base Tab
|
| 453 |
with gr.Tab("📚 Tudásbázis & AI API"):
|
| 454 |
-
gr.HTML("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 455 |
|
| 456 |
with gr.Row():
|
| 457 |
with gr.Column():
|
| 458 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 459 |
doc_content = gr.Textbox(
|
| 460 |
-
label="Tartalom",
|
| 461 |
-
placeholder="Illeszd be a dokumentum tartalmát...",
|
| 462 |
-
lines=8
|
|
|
|
| 463 |
)
|
| 464 |
-
|
|
|
|
|
|
|
|
|
|
| 465 |
|
| 466 |
with gr.Column():
|
|
|
|
| 467 |
knowledge_summary = gr.HTML(
|
| 468 |
"""<div class="info-box">
|
| 469 |
<strong>📊 Eternity Tudásbázis Összefoglaló:</strong><br>
|
| 470 |
-
📄 <strong>Dokumentumok:</strong>
|
| 471 |
-
📝 <strong>Összes szó:</strong>
|
| 472 |
🔍 <strong>Keresési pontosság:</strong> Magas<br>
|
| 473 |
-
⚡ <strong>Válaszidő:</strong> < 1 másodperc
|
|
|
|
| 474 |
</div>""",
|
| 475 |
-
label="Tudásbázis
|
| 476 |
)
|
| 477 |
|
|
|
|
| 478 |
api_refresh_btn = gr.Button("🔄 API Állapot Frissítés", variant="secondary")
|
| 479 |
|
| 480 |
api_status_detailed = gr.HTML(
|
|
@@ -483,94 +579,142 @@ def create_enhanced_eternity_interface():
|
|
| 483 |
🦙 <strong>Llama-3.1-8B:</strong> <span class="status-warning">Ellenőrzés alatt...</span><br>
|
| 484 |
🤖 <strong>OpenAI GPT-3.5:</strong> <span class="status-error">Nincs beállítva</span><br>
|
| 485 |
🔑 <strong>HF Token:</strong> <span class="status-good">Aktív</span><br>
|
| 486 |
-
⚙️ <strong>Fallback rendszer:</strong> <span class="status-good">Aktív</span>
|
|
|
|
| 487 |
</div>""",
|
| 488 |
-
label="API Diagnosztika"
|
| 489 |
)
|
| 490 |
|
| 491 |
-
# Technical Info Tab
|
| 492 |
with gr.Tab("⚙️ Technikai Információ"):
|
| 493 |
gr.HTML("""
|
| 494 |
-
<div class="
|
| 495 |
-
<
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
<
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
<
|
| 522 |
-
|
| 523 |
-
<
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
|
| 535 |
-
|
| 536 |
-
<
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 546 |
</div>
|
| 547 |
""")
|
| 548 |
|
| 549 |
-
# Event handlers
|
| 550 |
def chat_response(message, history, use_llama):
|
| 551 |
if not message.strip():
|
| 552 |
-
return history, ""
|
|
|
|
|
|
|
| 553 |
|
| 554 |
# Generate response
|
| 555 |
response, model_used = generate_enhanced_hungarian_response(message, use_llama)
|
| 556 |
|
|
|
|
|
|
|
| 557 |
# Update chat history
|
| 558 |
history.append([message, response])
|
| 559 |
|
| 560 |
# Update avatar emotion
|
| 561 |
emotion = get_avatar_emotion(response, model_used)
|
| 562 |
-
avatar_html = f"""<div class="avatar-display">{emotion}<br><small>Model: {model_used}</small></div>"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 563 |
|
| 564 |
-
return history, "", avatar_html
|
| 565 |
|
| 566 |
-
def
|
|
|
|
|
|
|
|
|
|
|
|
|
| 567 |
if name and personality:
|
| 568 |
-
|
| 569 |
-
|
| 570 |
-
|
| 571 |
-
|
| 572 |
-
|
| 573 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 574 |
|
| 575 |
def add_document(title, content):
|
| 576 |
if title and content:
|
|
@@ -585,8 +729,19 @@ def create_enhanced_eternity_interface():
|
|
| 585 |
🔍 <strong>Keresési pontosság:</strong> Magas<br>
|
| 586 |
⚡ <strong>Válaszidő:</strong> < 1 másodperc<br>
|
| 587 |
<div class="status-good">✅ Új dokumentum hozzáadva: {title}</div>
|
| 588 |
-
</div>"""
|
| 589 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
|
| 591 |
def refresh_api_status():
|
| 592 |
# Check Llama-3.1-8B API
|
|
@@ -606,7 +761,7 @@ def create_enhanced_eternity_interface():
|
|
| 606 |
🦙 <strong>Llama-3.1-8B API:</strong> {llama_status}<br>
|
| 607 |
🤖 <strong>OpenAI API:</strong> {openai_status}<br>
|
| 608 |
🔑 <strong>HF Token:</strong> {hf_status}<br>
|
| 609 |
-
📚 <strong>Tudásbázis
|
| 610 |
</div>"""
|
| 611 |
|
| 612 |
# Update detailed status
|
|
@@ -616,6 +771,7 @@ def create_enhanced_eternity_interface():
|
|
| 616 |
🤖 <strong>OpenAI GPT-3.5:</strong> {openai_status}<br>
|
| 617 |
🔑 <strong>HF Token:</strong> {hf_status}<br>
|
| 618 |
⚙️ <strong>Fallback rendszer:</strong> <span class="status-good">Aktív</span><br>
|
|
|
|
| 619 |
📊 <strong>Tudásbázis:</strong> {doc_count} dokumentum
|
| 620 |
</div>"""
|
| 621 |
|
|
@@ -625,24 +781,39 @@ def create_enhanced_eternity_interface():
|
|
| 625 |
send_btn.click(
|
| 626 |
chat_response,
|
| 627 |
inputs=[msg_input, chatbot, use_llama_checkbox],
|
| 628 |
-
outputs=[chatbot, msg_input, avatar_display]
|
| 629 |
)
|
| 630 |
|
| 631 |
msg_input.submit(
|
| 632 |
chat_response,
|
| 633 |
inputs=[msg_input, chatbot, use_llama_checkbox],
|
| 634 |
-
outputs=[chatbot, msg_input, avatar_display]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 635 |
)
|
| 636 |
|
| 637 |
save_persona_btn.click(
|
| 638 |
save_persona,
|
| 639 |
-
inputs=[persona_name, persona_age, persona_personality, persona_background],
|
| 640 |
outputs=[persona_status]
|
| 641 |
)
|
| 642 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 643 |
add_doc_btn.click(
|
| 644 |
add_document,
|
| 645 |
inputs=[doc_title, doc_content],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 646 |
outputs=[knowledge_summary]
|
| 647 |
)
|
| 648 |
|
|
@@ -655,8 +826,8 @@ def create_enhanced_eternity_interface():
|
|
| 655 |
|
| 656 |
# Initialize and run
|
| 657 |
if __name__ == "__main__":
|
| 658 |
-
print("🎭 Eternity POC v3.1 - Llama-3.1-8B
|
| 659 |
-
print("📚 Magyar interaktív avatar rendszer -
|
| 660 |
|
| 661 |
# Check environment
|
| 662 |
hf_token = os.getenv("HF_TOKEN")
|
|
@@ -674,18 +845,19 @@ if __name__ == "__main__":
|
|
| 674 |
|
| 675 |
# Load sample documents
|
| 676 |
sample_docs = [
|
| 677 |
-
("Életrajz", "Tanár vagyok, 15 éve dolgozom az oktatásban. Matematikát és fizikát tanítok középiskolában. Szeretem a diákokat és a tudás átadását."),
|
| 678 |
-
("Emlékek", "Gyermekkoromban a nagyszüleimnél töltöttem a nyarakat. Nagyapám mesélt a régi időkről, nagyanyám pedig főzni tanított meg.")
|
| 679 |
]
|
| 680 |
|
| 681 |
for title, content in sample_docs:
|
| 682 |
kb.add_document(title, content)
|
| 683 |
|
| 684 |
print(f"📄 {len(sample_docs)} minta dokumentum betöltve")
|
| 685 |
-
print("🚀 Eternity POC v3.1 - Llama-3.1-8B
|
| 686 |
print("🌐 Elérhető: http://localhost:7860")
|
| 687 |
print()
|
| 688 |
print("🦙 Llama-3.1-8B API ellenőrzés a háttérben...")
|
|
|
|
| 689 |
|
| 690 |
# Create and launch interface
|
| 691 |
interface = create_enhanced_eternity_interface()
|
|
|
|
| 128 |
endpoints_to_try = [
|
| 129 |
"https://api-inference.huggingface.co/models/meta-llama/Llama-3.1-8B-Instruct",
|
| 130 |
"https://api-inference.huggingface.co/models/meta-llama/Meta-Llama-3.1-8B-Instruct",
|
|
|
|
| 131 |
]
|
| 132 |
|
| 133 |
headers = {"Authorization": f"Bearer {hf_token}"}
|
| 134 |
|
| 135 |
for endpoint in endpoints_to_try:
|
| 136 |
try:
|
| 137 |
+
# Standard inference API test
|
| 138 |
+
response = requests.post(
|
| 139 |
+
endpoint,
|
| 140 |
+
headers=headers,
|
| 141 |
+
json={"inputs": "Test", "parameters": {"max_new_tokens": 10}},
|
| 142 |
+
timeout=10
|
| 143 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
if response.status_code == 200:
|
| 146 |
+
return f"✅ API Ready"
|
| 147 |
elif response.status_code == 503:
|
| 148 |
return "⏳ Model Loading"
|
| 149 |
elif response.status_code == 429:
|
|
|
|
| 335 |
return "😊" # Default happy emotion
|
| 336 |
|
| 337 |
def create_enhanced_eternity_interface():
|
| 338 |
+
"""Create the enhanced Eternity POC interface with improved UI"""
|
| 339 |
import gradio as gr
|
| 340 |
|
| 341 |
+
# Enhanced custom CSS for better styling
|
| 342 |
custom_css = """
|
| 343 |
+
.main-header {
|
| 344 |
+
text-align: center;
|
| 345 |
+
color: #2E86AB;
|
| 346 |
+
font-size: 32px;
|
| 347 |
+
margin-bottom: 25px;
|
| 348 |
+
font-weight: bold;
|
| 349 |
+
text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
|
| 350 |
+
}
|
| 351 |
.avatar-display {
|
| 352 |
text-align: center;
|
| 353 |
+
font-size: 100px;
|
| 354 |
+
padding: 25px;
|
| 355 |
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 356 |
border-radius: 20px;
|
| 357 |
color: white;
|
| 358 |
+
margin: 15px 0;
|
| 359 |
+
box-shadow: 0 8px 16px rgba(0,0,0,0.2);
|
| 360 |
+
transition: all 0.3s ease;
|
| 361 |
+
}
|
| 362 |
+
.avatar-display:hover {
|
| 363 |
+
transform: translateY(-2px);
|
| 364 |
+
box-shadow: 0 12px 24px rgba(0,0,0,0.3);
|
| 365 |
}
|
| 366 |
.status-good { color: #28a745; font-weight: bold; }
|
| 367 |
.status-warning { color: #ffc107; font-weight: bold; }
|
| 368 |
.status-error { color: #dc3545; font-weight: bold; }
|
| 369 |
.info-box {
|
| 370 |
+
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
| 371 |
+
padding: 20px;
|
| 372 |
+
border-radius: 15px;
|
| 373 |
+
border-left: 5px solid #2E86AB;
|
| 374 |
+
margin: 15px 0;
|
| 375 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
| 376 |
+
}
|
| 377 |
+
.feature-highlight {
|
| 378 |
+
background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
|
| 379 |
+
padding: 15px;
|
| 380 |
+
border-radius: 10px;
|
| 381 |
margin: 10px 0;
|
| 382 |
+
border-left: 4px solid #2196f3;
|
| 383 |
+
}
|
| 384 |
+
.tab-content {
|
| 385 |
+
padding: 20px;
|
| 386 |
+
background: #ffffff;
|
| 387 |
+
border-radius: 10px;
|
| 388 |
+
margin-top: 10px;
|
| 389 |
+
}
|
| 390 |
+
.send-button {
|
| 391 |
+
background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
|
| 392 |
+
border: none;
|
| 393 |
+
color: white;
|
| 394 |
+
padding: 12px 24px;
|
| 395 |
+
border-radius: 8px;
|
| 396 |
+
font-weight: bold;
|
| 397 |
+
transition: all 0.3s ease;
|
| 398 |
+
}
|
| 399 |
+
.send-button:hover {
|
| 400 |
+
transform: translateY(-1px);
|
| 401 |
+
box-shadow: 0 4px 8px rgba(0,0,0,0.2);
|
| 402 |
}
|
| 403 |
"""
|
| 404 |
|
| 405 |
+
with gr.Blocks(css=custom_css, title="Eternity POC - Magyar Avatar", theme=gr.themes.Soft()) as interface:
|
| 406 |
gr.HTML("""
|
| 407 |
<div class="main-header">
|
| 408 |
🎭 Eternity - Magyar Interaktív Avatar POC v3.1
|
| 409 |
</div>
|
| 410 |
+
<div class="feature-highlight">
|
| 411 |
+
<strong>🚀 Fejlett Proof-of-Concept az Eternity projekthez</strong><br>
|
| 412 |
🦙 <strong>Llama-3.1-8B API:</strong> Többszintű API kezelés és fallback rendszer<br>
|
| 413 |
🇭🇺 <strong>Magyar nyelv:</strong> Natív támogatás és természetes beszélgetés<br>
|
| 414 |
📚 <strong>Tudásbázis:</strong> Dokumentum-alapú kontextuális válaszok<br>
|
|
|
|
| 417 |
""")
|
| 418 |
|
| 419 |
with gr.Tabs():
|
| 420 |
+
# Chat Tab - Enhanced
|
| 421 |
with gr.Tab("💬 Beszélgetés"):
|
| 422 |
with gr.Row():
|
| 423 |
with gr.Column(scale=2):
|
| 424 |
chatbot = gr.Chatbot(
|
| 425 |
+
label="🗨️ Beszélgetés az Eternity avatarral",
|
| 426 |
+
height=450,
|
| 427 |
+
show_label=True,
|
| 428 |
+
avatar_images=None,
|
| 429 |
+
bubble_full_width=False
|
| 430 |
)
|
| 431 |
|
| 432 |
with gr.Row():
|
| 433 |
msg_input = gr.Textbox(
|
| 434 |
+
placeholder="Írj egy üzenetet magyarul...",
|
| 435 |
+
label="💬 Üzenet",
|
| 436 |
+
scale=4,
|
| 437 |
+
lines=1
|
| 438 |
)
|
| 439 |
+
send_btn = gr.Button("📤 Küldés", scale=1, variant="primary", elem_classes="send-button")
|
| 440 |
|
| 441 |
+
with gr.Row():
|
| 442 |
+
use_llama_checkbox = gr.Checkbox(
|
| 443 |
+
label="🦙 Llama-3.1-8B API használata (ajánlott)",
|
| 444 |
+
value=True,
|
| 445 |
+
info="Kapcsold ki a gyorsabb válaszokért"
|
| 446 |
+
)
|
| 447 |
+
clear_btn = gr.Button("🗑️ Beszélgetés törlése", variant="secondary")
|
| 448 |
|
| 449 |
with gr.Column(scale=1):
|
| 450 |
avatar_display = gr.HTML(
|
| 451 |
+
"""<div class="avatar-display">😊<br><small style="font-size: 16px;">Eternity Avatar<br>Készen állok!</small></div>""",
|
| 452 |
+
label="🎭 Avatar Megjelenítés"
|
| 453 |
)
|
| 454 |
|
| 455 |
model_status = gr.HTML(
|
|
|
|
| 458 |
🦙 <strong>Llama-3.1-8B API:</strong> <span class="status-warning">Ellenőrzés...</span><br>
|
| 459 |
🤖 <strong>OpenAI API:</strong> <span class="status-error">Nincs beállítva</span><br>
|
| 460 |
🔑 <strong>HF Token:</strong> <span class="status-good">Beállítva</span><br>
|
| 461 |
+
📚 <strong>Tudásbázis:</strong> <span id="doc-count">2</span> dokumentum
|
| 462 |
</div>""",
|
| 463 |
+
label="📊 Rendszer Állapot"
|
| 464 |
+
)
|
| 465 |
+
|
| 466 |
+
conversation_stats = gr.HTML(
|
| 467 |
+
"""<div class="info-box">
|
| 468 |
+
<strong>📈 Beszélgetés statisztika:</strong><br>
|
| 469 |
+
💬 <strong>Üzenetek:</strong> 0<br>
|
| 470 |
+
🤖 <strong>Utolsó model:</strong> -<br>
|
| 471 |
+
⏱️ <strong>Válaszidő:</strong> -<br>
|
| 472 |
+
🎭 <strong>Aktív persona:</strong> Alapértelmezett
|
| 473 |
+
</div>""",
|
| 474 |
+
label="📊 Beszélgetés Info"
|
| 475 |
)
|
| 476 |
|
| 477 |
+
# Persona Setup Tab - Enhanced
|
| 478 |
with gr.Tab("👤 Persona Beállítás"):
|
| 479 |
+
gr.HTML("""
|
| 480 |
+
<div class="tab-content">
|
| 481 |
+
<h3>🎭 Avatar Személyiség Konfigurálás</h3>
|
| 482 |
+
<p>Állítsd be az avatar személyiségét és háttértörténetét a természetesebb beszélgetésért.</p>
|
| 483 |
+
</div>
|
| 484 |
+
""")
|
| 485 |
|
| 486 |
with gr.Row():
|
| 487 |
+
with gr.Column():
|
| 488 |
+
persona_name = gr.Textbox(
|
| 489 |
+
label="👤 Név",
|
| 490 |
+
placeholder="pl. Anna, Péter, Zsófia",
|
| 491 |
+
info="Az avatar neve, amivel bemutatkozik"
|
| 492 |
+
)
|
| 493 |
+
persona_age = gr.Textbox(
|
| 494 |
+
label="🎂 Kor",
|
| 495 |
+
placeholder="pl. 25, 30, 45",
|
| 496 |
+
info="Az avatar életkora"
|
| 497 |
+
)
|
| 498 |
+
|
| 499 |
+
with gr.Column():
|
| 500 |
+
persona_personality = gr.Dropdown(
|
| 501 |
+
choices=["barátságos", "professzionális", "humoros", "bölcs", "energikus"],
|
| 502 |
+
label="🎭 Személyiség típus",
|
| 503 |
+
value="barátságos",
|
| 504 |
+
info="Válaszd ki az avatar alapvető személyiségét"
|
| 505 |
+
)
|
| 506 |
+
|
| 507 |
+
persona_mood = gr.Dropdown(
|
| 508 |
+
choices=["vidám", "nyugodt", "lelkes", "megfontolt", "segítőkész"],
|
| 509 |
+
label="😊 Hangulat",
|
| 510 |
+
value="vidám",
|
| 511 |
+
info="Az avatar aktuális hangulata"
|
| 512 |
+
)
|
| 513 |
|
| 514 |
persona_background = gr.Textbox(
|
| 515 |
+
label="📖 Háttér/Történet",
|
| 516 |
+
placeholder="Mesélj az avatar hátteréről, tapasztalatairól, hobbijairól...",
|
| 517 |
+
lines=4,
|
| 518 |
+
info="Részletes háttértörténet a kontextuális válaszokhoz"
|
| 519 |
)
|
| 520 |
|
| 521 |
+
with gr.Row():
|
| 522 |
+
save_persona_btn = gr.Button("💾 Persona Mentése", variant="primary", scale=2)
|
| 523 |
+
reset_persona_btn = gr.Button("🔄 Alaphelyzetbe", variant="secondary", scale=1)
|
| 524 |
+
|
| 525 |
+
persona_status = gr.HTML("""
|
| 526 |
+
<div class="info-box">
|
| 527 |
+
<strong>ℹ️ Persona állapot:</strong> Alapértelmezett beállítások aktívak
|
| 528 |
+
</div>
|
| 529 |
+
""")
|
| 530 |
|
| 531 |
+
# Knowledge Base Tab - Enhanced
|
| 532 |
with gr.Tab("📚 Tudásbázis & AI API"):
|
| 533 |
+
gr.HTML("""
|
| 534 |
+
<div class="tab-content">
|
| 535 |
+
<h3>📖 Dokumentum Feltöltés és API Állapot</h3>
|
| 536 |
+
<p>Adj hozzá dokumentumokat a tudásbázishoz és ellenőrizd az AI API-k állapotát.</p>
|
| 537 |
+
</div>
|
| 538 |
+
""")
|
| 539 |
|
| 540 |
with gr.Row():
|
| 541 |
with gr.Column():
|
| 542 |
+
gr.HTML("<h4>📄 Új Dokumentum Hozzáadása</h4>")
|
| 543 |
+
doc_title = gr.Textbox(
|
| 544 |
+
label="📝 Dokumentum címe",
|
| 545 |
+
placeholder="pl. Életrajz, Hobbik, Tapasztalatok",
|
| 546 |
+
info="Rövid, leíró cím a dokumentumhoz"
|
| 547 |
+
)
|
| 548 |
doc_content = gr.Textbox(
|
| 549 |
+
label="📄 Tartalom",
|
| 550 |
+
placeholder="Illeszd be vagy írd be a dokumentum tartalmát...",
|
| 551 |
+
lines=8,
|
| 552 |
+
info="A teljes dokumentum szövege"
|
| 553 |
)
|
| 554 |
+
|
| 555 |
+
with gr.Row():
|
| 556 |
+
add_doc_btn = gr.Button("📄 Dokumentum Hozzáadása", variant="primary", scale=2)
|
| 557 |
+
clear_docs_btn = gr.Button("🗑️ Tudásbázis törlése", variant="secondary", scale=1)
|
| 558 |
|
| 559 |
with gr.Column():
|
| 560 |
+
gr.HTML("<h4>📊 Tudásbázis Állapot</h4>")
|
| 561 |
knowledge_summary = gr.HTML(
|
| 562 |
"""<div class="info-box">
|
| 563 |
<strong>📊 Eternity Tudásbázis Összefoglaló:</strong><br>
|
| 564 |
+
📄 <strong>Dokumentumok:</strong> 2<br>
|
| 565 |
+
📝 <strong>Összes szó:</strong> ~150<br>
|
| 566 |
🔍 <strong>Keresési pontosság:</strong> Magas<br>
|
| 567 |
+
⚡ <strong>Válaszidő:</strong> < 1 másodperc<br>
|
| 568 |
+
📚 <strong>Minta dokumentumok:</strong> Életrajz, Emlékek
|
| 569 |
</div>""",
|
| 570 |
+
label="📈 Tudásbázis Statisztika"
|
| 571 |
)
|
| 572 |
|
| 573 |
+
gr.HTML("<h4>🔧 API Diagnosztika</h4>")
|
| 574 |
api_refresh_btn = gr.Button("🔄 API Állapot Frissítés", variant="secondary")
|
| 575 |
|
| 576 |
api_status_detailed = gr.HTML(
|
|
|
|
| 579 |
🦙 <strong>Llama-3.1-8B:</strong> <span class="status-warning">Ellenőrzés alatt...</span><br>
|
| 580 |
🤖 <strong>OpenAI GPT-3.5:</strong> <span class="status-error">Nincs beállítva</span><br>
|
| 581 |
🔑 <strong>HF Token:</strong> <span class="status-good">Aktív</span><br>
|
| 582 |
+
⚙️ <strong>Fallback rendszer:</strong> <span class="status-good">Aktív</span><br>
|
| 583 |
+
📡 <strong>Kapcsolat:</strong> <span class="status-good">Stabil</span>
|
| 584 |
</div>""",
|
| 585 |
+
label="🔍 API Diagnosztika"
|
| 586 |
)
|
| 587 |
|
| 588 |
+
# Technical Info Tab - Enhanced
|
| 589 |
with gr.Tab("⚙️ Technikai Információ"):
|
| 590 |
gr.HTML("""
|
| 591 |
+
<div class="tab-content">
|
| 592 |
+
<div class="info-box">
|
| 593 |
+
<h3>🎭 Eternity POC v3.1 - Llama-3.1-8B API Integration</h3>
|
| 594 |
+
|
| 595 |
+
<div class="feature-highlight">
|
| 596 |
+
<h4>🚀 Főbb Jellemzők:</h4>
|
| 597 |
+
<ul>
|
| 598 |
+
<li><strong>🦙 Llama-3.1-8B-Instruct API</strong> - Meta legújabb 8B paraméteres modellje</li>
|
| 599 |
+
<li><strong>Magyar nyelvű beszélgetés</strong> - Natív magyar támogatás többszintű API-val</li>
|
| 600 |
+
<li><strong>Intelligens fallback rendszer</strong> - Llama → OpenAI → Szabály-alapú</li>
|
| 601 |
+
<li><strong>Dinamikus avatar megjelenítés</strong> - Érzelmi visszajelzés szimulációval</li>
|
| 602 |
+
<li><strong>Kontextuális tudásbázis</strong> - Dokumentum-alapú válaszgenerálás</li>
|
| 603 |
+
<li><strong>Beszélgetési memória</strong> - Korábbi interakciók kontextusa</li>
|
| 604 |
+
<li><strong>Robusztus hibakezelés</strong> - Többszintű API ellenőrzés</li>
|
| 605 |
+
</ul>
|
| 606 |
+
</div>
|
| 607 |
+
|
| 608 |
+
<div class="feature-highlight">
|
| 609 |
+
<h4>🦙 Llama-3.1-8B Jellemzők:</h4>
|
| 610 |
+
<ul>
|
| 611 |
+
<li><strong>Paraméterek:</strong> 8 milliárd (8B)</li>
|
| 612 |
+
<li><strong>Kontextus hossz:</strong> 128,000 token</li>
|
| 613 |
+
<li><strong>Nyelvek:</strong> 8 nyelv (magyar támogatással)</li>
|
| 614 |
+
<li><strong>Optimalizálás:</strong> Instrukció-követés és beszélgetés</li>
|
| 615 |
+
<li><strong>Licenc:</strong> Llama 3.1 Community License</li>
|
| 616 |
+
<li><strong>Kiadás:</strong> 2024. július (Meta AI)</li>
|
| 617 |
+
</ul>
|
| 618 |
+
</div>
|
| 619 |
+
|
| 620 |
+
<div class="feature-highlight">
|
| 621 |
+
<h4>🔧 Technikai Specifikáció:</h4>
|
| 622 |
+
<ul>
|
| 623 |
+
<li><strong>Platform:</strong> Hugging Face Spaces</li>
|
| 624 |
+
<li><strong>AI Model:</strong> Meta Llama-3.1-8B-Instruct (API)</li>
|
| 625 |
+
<li><strong>Fallback:</strong> OpenAI GPT-3.5-turbo</li>
|
| 626 |
+
<li><strong>Frontend:</strong> Gradio 4.x (Soft Theme)</li>
|
| 627 |
+
<li><strong>Backend:</strong> Python 3.11</li>
|
| 628 |
+
<li><strong>API Kezelés:</strong> Többszintű endpoint támogatás</li>
|
| 629 |
+
<li><strong>UI Framework:</strong> Enhanced CSS + Responsive Design</li>
|
| 630 |
+
</ul>
|
| 631 |
+
</div>
|
| 632 |
+
|
| 633 |
+
<div class="feature-highlight">
|
| 634 |
+
<h4>🔑 Környezeti Változók:</h4>
|
| 635 |
+
<ul>
|
| 636 |
+
<li><strong>HF_TOKEN:</strong> Hugging Face API token (kötelező Llama-3.1-8B-hoz)</li>
|
| 637 |
+
<li><strong>OPENAI_API_KEY:</strong> OpenAI API kulcs (opcionális fallback)</li>
|
| 638 |
+
</ul>
|
| 639 |
+
</div>
|
| 640 |
+
|
| 641 |
+
<div class="feature-highlight">
|
| 642 |
+
<h4>🚀 Fejlesztési Roadmap:</h4>
|
| 643 |
+
<ol>
|
| 644 |
+
<li><strong>Hang integráció</strong> - Magyar TTS integráció Llama-3.1-8B válaszokhoz</li>
|
| 645 |
+
<li><strong>Valós avatar generálás</strong> - Video avatar HTML helyett</li>
|
| 646 |
+
<li><strong>Multimodális képességek</strong> - Kép input és feldolgozás</li>
|
| 647 |
+
<li><strong>Teljesítmény optimalizálás</strong> - Sub-1s válaszidő</li>
|
| 648 |
+
<li><strong>Produkciós deployment</strong> - Skálázható infrastruktúra</li>
|
| 649 |
+
</ol>
|
| 650 |
+
</div>
|
| 651 |
+
|
| 652 |
+
<hr style="margin: 20px 0;">
|
| 653 |
+
<p style="text-align: center;">
|
| 654 |
+
<strong>Verzió:</strong> POC 3.1 - Enhanced UI & Llama-3.1-8B Integration<br>
|
| 655 |
+
<strong>Utolsó frissítés:</strong> 2025. október<br>
|
| 656 |
+
<strong>Fejlesztő:</strong> Eternity Team<br>
|
| 657 |
+
<strong>Státusz:</strong> <span class="status-good">Aktív és működőképes</span>
|
| 658 |
+
</p>
|
| 659 |
+
</div>
|
| 660 |
</div>
|
| 661 |
""")
|
| 662 |
|
| 663 |
+
# Event handlers with enhanced functionality
|
| 664 |
def chat_response(message, history, use_llama):
|
| 665 |
if not message.strip():
|
| 666 |
+
return history, "", gr.update(), gr.update()
|
| 667 |
+
|
| 668 |
+
start_time = time.time()
|
| 669 |
|
| 670 |
# Generate response
|
| 671 |
response, model_used = generate_enhanced_hungarian_response(message, use_llama)
|
| 672 |
|
| 673 |
+
response_time = time.time() - start_time
|
| 674 |
+
|
| 675 |
# Update chat history
|
| 676 |
history.append([message, response])
|
| 677 |
|
| 678 |
# Update avatar emotion
|
| 679 |
emotion = get_avatar_emotion(response, model_used)
|
| 680 |
+
avatar_html = f"""<div class="avatar-display">{emotion}<br><small style="font-size: 16px;">Model: {model_used}<br>Válaszidő: {response_time:.1f}s</small></div>"""
|
| 681 |
+
|
| 682 |
+
# Update conversation stats
|
| 683 |
+
message_count = len(kb.conversation_history)
|
| 684 |
+
persona_name = kb.persona_data.get('name', 'Alapértelmezett')
|
| 685 |
+
|
| 686 |
+
stats_html = f"""<div class="info-box">
|
| 687 |
+
<strong>📈 Beszélgetés statisztika:</strong><br>
|
| 688 |
+
💬 <strong>Üzenetek:</strong> {message_count}<br>
|
| 689 |
+
🤖 <strong>Utolsó model:</strong> {model_used}<br>
|
| 690 |
+
⏱️ <strong>Válaszidő:</strong> {response_time:.1f}s<br>
|
| 691 |
+
🎭 <strong>Aktív persona:</strong> {persona_name}
|
| 692 |
+
</div>"""
|
| 693 |
|
| 694 |
+
return history, "", avatar_html, stats_html
|
| 695 |
|
| 696 |
+
def clear_chat():
|
| 697 |
+
kb.conversation_history = []
|
| 698 |
+
return [], """<div class="avatar-display">😊<br><small style="font-size: 16px;">Eternity Avatar<br>Új beszélgetés!</small></div>"""
|
| 699 |
+
|
| 700 |
+
def save_persona(name, age, personality, background, mood):
|
| 701 |
if name and personality:
|
| 702 |
+
# Add mood to background
|
| 703 |
+
enhanced_background = f"{background}\nJelenlegi hangulat: {mood}"
|
| 704 |
+
kb.add_persona_info(name, age, personality, enhanced_background)
|
| 705 |
+
|
| 706 |
+
return f"""<div class="info-box">
|
| 707 |
+
<div class="status-good">✅ Persona sikeresen mentve!</div>
|
| 708 |
+
<strong>👤 Név:</strong> {name}<br>
|
| 709 |
+
<strong>🎭 Személyiség:</strong> {personality}<br>
|
| 710 |
+
<strong>😊 Hangulat:</strong> {mood}<br>
|
| 711 |
+
<strong>💬 Beszédstílus:</strong> {kb.persona_data.get('conversation_style', 'természetes')}
|
| 712 |
+
</div>"""
|
| 713 |
+
return """<div class="info-box"><div class="status-error">❌ Kérlek add meg legalább a nevet és a személyiség típust!</div></div>"""
|
| 714 |
+
|
| 715 |
+
def reset_persona():
|
| 716 |
+
kb.persona_data = {}
|
| 717 |
+
return "", "", "barátságos", "", "vidám", """<div class="info-box"><strong>ℹ️ Persona állapot:</strong> Alapértelmezett beállítások visszaállítva</div>"""
|
| 718 |
|
| 719 |
def add_document(title, content):
|
| 720 |
if title and content:
|
|
|
|
| 729 |
🔍 <strong>Keresési pontosság:</strong> Magas<br>
|
| 730 |
⚡ <strong>Válaszidő:</strong> < 1 másodperc<br>
|
| 731 |
<div class="status-good">✅ Új dokumentum hozzáadva: {title}</div>
|
| 732 |
+
</div>""", "", ""
|
| 733 |
+
return gr.update(), title, content
|
| 734 |
+
|
| 735 |
+
def clear_knowledge_base():
|
| 736 |
+
kb.knowledge_data = {}
|
| 737 |
+
return """<div class="info-box">
|
| 738 |
+
<strong>📊 Eternity Tudásbázis Összefoglaló:</strong><br>
|
| 739 |
+
📄 <strong>Dokumentumok:</strong> 0<br>
|
| 740 |
+
📝 <strong>Összes szó:</strong> 0<br>
|
| 741 |
+
🔍 <strong>Keresési pontosság:</strong> -<br>
|
| 742 |
+
⚡ <strong>Válaszidő:</strong> -<br>
|
| 743 |
+
<div class="status-warning">⚠️ Tudásbázis törölve</div>
|
| 744 |
+
</div>"""
|
| 745 |
|
| 746 |
def refresh_api_status():
|
| 747 |
# Check Llama-3.1-8B API
|
|
|
|
| 761 |
🦙 <strong>Llama-3.1-8B API:</strong> {llama_status}<br>
|
| 762 |
🤖 <strong>OpenAI API:</strong> {openai_status}<br>
|
| 763 |
🔑 <strong>HF Token:</strong> {hf_status}<br>
|
| 764 |
+
📚 <strong>Tudásbázis:</strong> {doc_count} dokumentum
|
| 765 |
</div>"""
|
| 766 |
|
| 767 |
# Update detailed status
|
|
|
|
| 771 |
🤖 <strong>OpenAI GPT-3.5:</strong> {openai_status}<br>
|
| 772 |
🔑 <strong>HF Token:</strong> {hf_status}<br>
|
| 773 |
⚙️ <strong>Fallback rendszer:</strong> <span class="status-good">Aktív</span><br>
|
| 774 |
+
📡 <strong>Kapcsolat:</strong> <span class="status-good">Stabil</span><br>
|
| 775 |
📊 <strong>Tudásbázis:</strong> {doc_count} dokumentum
|
| 776 |
</div>"""
|
| 777 |
|
|
|
|
| 781 |
send_btn.click(
|
| 782 |
chat_response,
|
| 783 |
inputs=[msg_input, chatbot, use_llama_checkbox],
|
| 784 |
+
outputs=[chatbot, msg_input, avatar_display, conversation_stats]
|
| 785 |
)
|
| 786 |
|
| 787 |
msg_input.submit(
|
| 788 |
chat_response,
|
| 789 |
inputs=[msg_input, chatbot, use_llama_checkbox],
|
| 790 |
+
outputs=[chatbot, msg_input, avatar_display, conversation_stats]
|
| 791 |
+
)
|
| 792 |
+
|
| 793 |
+
clear_btn.click(
|
| 794 |
+
clear_chat,
|
| 795 |
+
outputs=[chatbot, avatar_display]
|
| 796 |
)
|
| 797 |
|
| 798 |
save_persona_btn.click(
|
| 799 |
save_persona,
|
| 800 |
+
inputs=[persona_name, persona_age, persona_personality, persona_background, persona_mood],
|
| 801 |
outputs=[persona_status]
|
| 802 |
)
|
| 803 |
|
| 804 |
+
reset_persona_btn.click(
|
| 805 |
+
reset_persona,
|
| 806 |
+
outputs=[persona_name, persona_age, persona_personality, persona_background, persona_mood, persona_status]
|
| 807 |
+
)
|
| 808 |
+
|
| 809 |
add_doc_btn.click(
|
| 810 |
add_document,
|
| 811 |
inputs=[doc_title, doc_content],
|
| 812 |
+
outputs=[knowledge_summary, doc_title, doc_content]
|
| 813 |
+
)
|
| 814 |
+
|
| 815 |
+
clear_docs_btn.click(
|
| 816 |
+
clear_knowledge_base,
|
| 817 |
outputs=[knowledge_summary]
|
| 818 |
)
|
| 819 |
|
|
|
|
| 826 |
|
| 827 |
# Initialize and run
|
| 828 |
if __name__ == "__main__":
|
| 829 |
+
print("🎭 Eternity POC v3.1 - Enhanced UI & Llama-3.1-8B Integration indítása...")
|
| 830 |
+
print("📚 Magyar interaktív avatar rendszer - Fejlesztett felhasználói felület")
|
| 831 |
|
| 832 |
# Check environment
|
| 833 |
hf_token = os.getenv("HF_TOKEN")
|
|
|
|
| 845 |
|
| 846 |
# Load sample documents
|
| 847 |
sample_docs = [
|
| 848 |
+
("Életrajz", "Tanár vagyok, 15 éve dolgozom az oktatásban. Matematikát és fizikát tanítok középiskolában. Szeretem a diákokat és a tudás átadását. Szabadidőmben szívesen olvasok és túrázok."),
|
| 849 |
+
("Emlékek", "Gyermekkoromban a nagyszüleimnél töltöttem a nyarakat. Nagyapám mesélt a régi időkről, nagyanyám pedig főzni tanított meg. Ezek az emlékek nagyon fontosak számomra.")
|
| 850 |
]
|
| 851 |
|
| 852 |
for title, content in sample_docs:
|
| 853 |
kb.add_document(title, content)
|
| 854 |
|
| 855 |
print(f"📄 {len(sample_docs)} minta dokumentum betöltve")
|
| 856 |
+
print("🚀 Eternity POC v3.1 - Enhanced UI & Llama-3.1-8B Integration elindítva!")
|
| 857 |
print("🌐 Elérhető: http://localhost:7860")
|
| 858 |
print()
|
| 859 |
print("🦙 Llama-3.1-8B API ellenőrzés a háttérben...")
|
| 860 |
+
print("🎨 Fejlesztett UI és UX funkciók aktívak")
|
| 861 |
|
| 862 |
# Create and launch interface
|
| 863 |
interface = create_enhanced_eternity_interface()
|