Spaces:
Runtime error
Runtime error
File size: 616 Bytes
e4eab97 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import gradio as gr
import pandas as pd
import json
from tqdm import tqdm
from predict import Preprocess, Facility_Model, obj_Facility_Model, processor
def predict_facility(data):
pred_data = processor.process_tokenizer(data)
predictions = obj_Facility_Model.inference(pred_data)
return json.loads(predictions)
iface = gr.Interface(
fn=predict_facility,
inputs="text",
outputs="json",
title=" Single Facility Prediction",
description="Predict the facility based on input data.",
#examples=[["kilifi"], ["mombasa"], ["nairobi"]],
)
if __name__ == "__main__":
iface.launch() |