PRV-AI-1.0 / app.py
Prava1's picture
Create app.py
d485f8b verified
raw
history blame contribute delete
722 Bytes
import gradio as gr
from transformers import MobileBertTokenizer, pipeline
tokenizer = MobileBertTokenizer.from_pretrained("Prava1/PRV-AI-1.0")
classifier = pipeline(
"text-classification",
model="Prava1/PRV-AI-1.0",
tokenizer=tokenizer
)
def analyze(text):
result = classifier(text)[0]
label = result["label"]
score = result["score"]
return f"Result: {label} (Confidence: {score:.2%})"
app = gr.Interface(
fn=analyze,
inputs=gr.Textbox(
label="Enter any text",
placeholder="Type something here..."
),
outputs=gr.Textbox(label="PRV AI 1.0 Result"),
title="PRV AI 1.0",
description="Lightweight AI model by PRV — 24.5M parameters"
)
app.launch()
```