Manish014's picture
update
2bfcd91 verified
raw
history blame
802 Bytes
import gradio as gr
from transformers import pipeline
pipe = pipeline("summarization", model="Manish014/review-summariser-gpt-config1")
def summarize(text):
if not text.strip():
return "Please enter a review."
return pipe(text)[0]["summary_text"]
example_reviews = [
["This product leaks water and smells like burnt plastic."],
["Absolutely loved the screen resolution and battery life."],
["Worst purchase I've made. Do not recommend at all."]
]
demo = gr.Interface(
fn=summarize,
inputs=gr.Textbox(lines=5, placeholder="Enter product review..."),
outputs=gr.Textbox(label="Summary"),
examples=example_reviews,
title="Review Summariser GPT - Config 1",
description="Enter a long product review and get a helpful short summary."
)
demo.launch()