summarization / summarization.py
Julián Ganzabal
first commit
2f18c72
raw
history blame
766 Bytes
import numpy as np
import gradio as gr
def get_summarization_io():
chunk_size = 2000
chunk_overlap = 100
transcripts = np.load(
f'data/in_summary-text-davinci-003-{chunk_size}-{chunk_overlap}.npy',
allow_pickle=True
)
examples = list(transcripts)
model_name = "mrm8488/bert2bert_shared-spanish-finetuned-summarization"
hf_summarization_io_api = gr.load(
model_name,
src="models",
hf_token="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",
examples=examples,
title=f'Summarization con {model_name}',
description='La primera inferencia tarda un poco por que carga el modelo, luego es más rapido'
)
return hf_summarization_io_api
get_summarization_io().launch()