Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Conversation

mgoin
Copy link
Member

@mgoin mgoin commented Mar 21, 2023

An ease of use improvement to simplify demo code and reduce chance for errors.

Now we can do

from deepsparse import Engine

bert_engine = Engine(model="zoo:nlp/text_classification/obert-base/pytorch/huggingface/mnli/pruned90_quant-none")

inputs = bert_engine.generate_random_inputs()
output = bert_engine(inputs)

instead of

from deepsparse import Engine
from deepsparse.utils import generate_random_inputs, model_to_path

sparsezoo_stub = "zoo:nlp/text_classification/obert-base/pytorch/huggingface/mnli/pruned90_quant-none"
bert_engine = Engine(model=sparsezoo_stub)

inputs = generate_random_inputs(model_to_path(sparsezoo_stub), batch_size)
output = bert_engine(inputs)

@mgoin mgoin requested review from a team, markurtz, DaltheCow and KSGulin and removed request for a team March 21, 2023 14:34
@mgoin mgoin merged commit a8079c0 into main Mar 21, 2023
@mgoin mgoin deleted the engine-random-inputs branch March 21, 2023 15:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants