File size: 594 Bytes
430d0f0
3d630f2
 
430d0f0
3d630f2
 
430d0f0
 
 
3d630f2
430d0f0
 
 
3d630f2
 
430d0f0
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from transformers import pipeline


model = pipeline("summarization", model="eliori/dialogue_summarization-finetuned")


def summarize(prompt):
    completion = model(prompt)[0]["summary_text"]
    return completion

title = "Write or Paste in a Dialogue"
description = """
This model is used to summarize dialogues.
"""

import gradio as gr
# from huggingface_hub import InferenceClient
gr.Interface(
    fn=summarize,
    inputs="textbox",
    outputs="text",
    title=title,
    description=description,
    examples=[["#Person1#: (dialogue) #Person2#: (response to dialogue)"]],
).launch()