|
from fastapi import FastAPI |
|
from app.routes import prediction |
|
from app.routes.prediction import predict |
|
|
|
from app.routes import home |
|
import gradio as gr |
|
|
|
|
|
app = FastAPI() |
|
|
|
|
|
app.include_router( |
|
home.router, |
|
tags=["home"], |
|
) |
|
|
|
|
|
app.include_router( |
|
prediction.router, |
|
prefix="/predict", |
|
tags=["prediction"], |
|
) |
|
|
|
iface = gr.Interface( |
|
fn=predict, |
|
inputs="text", |
|
outputs="text", |
|
title="D360 Real Estate Challenge", |
|
description="Haga su pregunta a nuestro agente de real estate", |
|
examples=[ |
|
"cuantas propiedades tienen alberca?", |
|
"Cual es el precio promedio de las propiedades en venta?", |
|
"cuantos apartamentos hay en renta?", |
|
"cuantos departamentos en venta tienen más de dos dormitorios?", |
|
], |
|
) |
|
iface.launch() |
|
|