How to load local models


I looked through the tutorial pages on

It seems to me that gradio can launch the app with the models from huggingface.

Is it possible to load the model stored in local machine? If possible, could you tell me how to?

1 Like

I just solved, here an example:

import gradio as gr
from transformers import pipeline

summarizer = pipeline(“summarization”, model)

def summary(text):
return summarizer(text)[0][“summary_text”]

with gr.Blocks() as demo:
input_text = gr.Textbox(placeholder=“Ingresa la reseña del libro…”, lines=4)
output_text = gr.Textbox(label=“Resumen”)
btn = gr.Button(“Genera el resumen”), input_text, output_text)