File size: 1,349 Bytes
c4d9410 e037c22 c4d9410 e037c22 c4d9410 3cc00a5 c4d9410 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import gradio as gr
from mock_model import predict
def run_app(amount, stage, industry, lead_score, emails, meetings, close_gap):
input_data = {
"amount": amount,
"stage": stage,
"industry": industry,
"lead_score": lead_score,
"emails_last_7_days": emails,
"meetings_last_30_days": meetings,
"close_date_gap": close_gap
}
result = predict(input_data, None, None, None)
return result["score"], result["confidence"], result["risk"], result["recommendation"]
demo = gr.Interface(
fn=run_app,
title="AI-Powered Deal Qualification Engine (Demo)",
inputs=[
gr.Number(label="Amount (USD)", value=50000),
gr.Dropdown(["Prospecting", "Proposal/Price Quote", "Negotiation", "Closed Won", "Closed Lost"], label="Stage"),
gr.Textbox(label="Industry", value="Software"),
gr.Number(label="Lead Score", value=85),
gr.Number(label="Emails in Last 7 Days", value=3),
gr.Number(label="Meetings in Last 30 Days", value=2),
gr.Number(label="Close Date Gap (days)", value=10)
],
outputs=[
gr.Number(label="AI Score (0–100)"),
gr.Number(label="Confidence (0–1)"),
gr.Textbox(label="Risk Level"),
gr.Textbox(label="Recommendation")
]
)
if __name__ == "__main__":
demo.launch()
|