File size: 766 Bytes
2f18c72
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
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()