Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -692,48 +692,21 @@ Répondez de manière précise et structurée en vous basant UNIQUEMENT sur ce c
|
|
| 692 |
|
| 693 |
|
| 694 |
# =============================================================================
|
| 695 |
-
# GRADIO
|
| 696 |
# =============================================================================
|
| 697 |
|
| 698 |
-
example_questions = [
|
| 699 |
-
"Je cherche un F3 à Oran avec un budget de 10 millions",
|
| 700 |
-
"Quelles sont les étapes pour acheter un appartement en Algérie ?",
|
| 701 |
-
"Quels documents faut-il pour une location ?",
|
| 702 |
-
"Prix moyen des appartements à Alger ?",
|
| 703 |
-
"Comment fonctionne le crédit immobilier en Algérie ?"
|
| 704 |
-
]
|
| 705 |
-
formatted_examples = [[q, 1024, 0.3, 0.85] for q in example_questions]
|
| 706 |
-
|
| 707 |
demo = gr.Interface(
|
| 708 |
fn=respond,
|
| 709 |
inputs=[
|
| 710 |
-
gr.Textbox(
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
|
| 714 |
-
),
|
| 715 |
-
gr.Slider(minimum=256, maximum=2048, value=1024, step=64, label="Tokens maximum"),
|
| 716 |
-
gr.Slider(minimum=0.1, maximum=1.0, value=0.3, step=0.1, label="Température"),
|
| 717 |
-
gr.Slider(minimum=0.5, maximum=1.0, value=0.85, step=0.05, label="Top-p"),
|
| 718 |
],
|
| 719 |
outputs=[
|
| 720 |
-
gr.Textbox(label="
|
| 721 |
-
gr.Textbox(label="
|
| 722 |
],
|
| 723 |
-
title="🏠 Assistant Immobilier Algérie - Version Avancée",
|
| 724 |
-
description="""
|
| 725 |
-
**Assistant intelligent spécialisé en immobilier en Algérie**
|
| 726 |
-
|
| 727 |
-
Je peux vous aider avec :
|
| 728 |
-
- 🔍 Recherche de biens (appartements, maisons, terrains...)
|
| 729 |
-
- 📋 Démarches administratives et juridiques
|
| 730 |
-
- 💰 Questions sur les prix et le marché
|
| 731 |
-
- 🏦 Financement et crédits immobiliers
|
| 732 |
-
|
| 733 |
-
*Posez votre question ci-dessous !*
|
| 734 |
-
""",
|
| 735 |
-
examples=formatted_examples,
|
| 736 |
-
cache_examples=False,
|
| 737 |
api_name="predict"
|
| 738 |
)
|
| 739 |
|
|
@@ -741,11 +714,5 @@ if __name__ == "__main__":
|
|
| 741 |
demo.launch(
|
| 742 |
server_name="0.0.0.0",
|
| 743 |
server_port=7860,
|
| 744 |
-
|
| 745 |
-
show_error=True,
|
| 746 |
-
theme=gr.themes.Soft(),
|
| 747 |
-
css="""
|
| 748 |
-
.gradio-container { font-family: 'Inter', sans-serif; }
|
| 749 |
-
.gr-button { background: #2563eb !important; }
|
| 750 |
-
"""
|
| 751 |
)
|
|
|
|
| 692 |
|
| 693 |
|
| 694 |
# =============================================================================
|
| 695 |
+
# GRADIO API
|
| 696 |
# =============================================================================
|
| 697 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 698 |
demo = gr.Interface(
|
| 699 |
fn=respond,
|
| 700 |
inputs=[
|
| 701 |
+
gr.Textbox(label="question"),
|
| 702 |
+
gr.Number(value=1024, label="tokens_max"),
|
| 703 |
+
gr.Number(value=0.3, label="temperature"),
|
| 704 |
+
gr.Number(value=0.85, label="top_p"),
|
|
|
|
|
|
|
|
|
|
|
|
|
| 705 |
],
|
| 706 |
outputs=[
|
| 707 |
+
gr.Textbox(label="response"),
|
| 708 |
+
gr.Textbox(label="context"),
|
| 709 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 710 |
api_name="predict"
|
| 711 |
)
|
| 712 |
|
|
|
|
| 714 |
demo.launch(
|
| 715 |
server_name="0.0.0.0",
|
| 716 |
server_port=7860,
|
| 717 |
+
show_error=True
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 718 |
)
|