admchiem
Initial commit with LFS-tracked model and assets
5121a37
raw
history blame
576 Bytes
import gradio as gr
from inference import model # Ton modèle préparé dans `inference.py`
def predict_intent(text):
result = model.predict(text)
return f"Intent: {result['intent']}\nIs OOS: {result['is_oos']}\nConfidence: {result['confidence']}\nOOS Score: {result['oos_score']:.3f}"
iface = gr.Interface(
fn=predict_intent,
inputs=gr.Textbox(lines=2, placeholder="Enter a sentence..."),
outputs="text",
title="Intent & OOS Detector",
description="Type a sentence and get its predicted intent or detect if it's out-of-scope."
)
iface.launch()