GenAi / app.py
oluinioluwa814's picture
Update app.py
6b50ae3 verified
raw
history blame contribute delete
693 Bytes
#use a pipeline as high level language
import torch
import gradio as gr
from transformers import pipeline
text_summary = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6",
torch_dtype=torch.bfloat16)
def summary(input):
output = text_summary(input)
return output[0]['summary_text']
gr.close_all()
demo = gr.Interface(
fn=summary,
inputs=[gr.Textbox(label="input Note to summarize", lines=6)],
outputs=[gr.Textbox(label="summarize Note", lines=6)],
title="3mtt GenAi project: Note summarize ",
description="This application will be used to summeraize note")
demo.launch(debug=True)