Hello, I am having trouble building a bento after ...
# ask-for-help
t
Hello, I am having trouble building a bento after the release of
bentoml==1.3.12
. I have a directory with the following structure:
Copy code
.
├── requirements.txt
└── src
    ├── __init__.py
    ├── bentofile.yaml
    └── service.py
The
service.py
looks like this:
Copy code
from __future__ import annotations
import bentoml

with bentoml.importing():
    from transformers import pipeline


EXAMPLE_INPUT = "Breaking News: In an astonishing turn of events, the small town of Willow Creek has been taken by storm as local resident Jerry Thompson's cat, Whiskers, performed what witnesses are calling a 'miraculous and gravity-defying leap.' Eyewitnesses report that Whiskers, an otherwise unremarkable tabby cat, jumped a record-breaking 20 feet into the air to catch a fly. The event, which took place in Thompson's backyard, is now being investigated by scientists for potential breaches in the laws of physics. Local authorities are considering a town festival to celebrate what is being hailed as 'The Leap of the Century."


@bentoml.service
class Summarization:
    def __init__(self) -> None:
        self.pipeline = pipeline('summarization')

    @bentoml.api
    def summarize(self, text: str = EXAMPLE_INPUT) -> str:
        result = self.pipeline(text)
        return f"Hello world! Here's your summary: {result[0]['summary_text']}"
The
bentofile.yaml
looks like this
Copy code
service: 'service:Summarization'
labels:
  owner: bentoml-team
  project: gallery
include:
  - '*.py'
python:
  packages:
    - torch
    - transformers
docker:
  python_version: "3.10"
The command
bentoml build -f ./src/bentofile.yaml ./src/
works with
bentoml==1.3.11
but not with
bentoml==1.3.12
. Has the cli changed?
j
@Frost Ming
f
You are right , that is a mistake when refactoring related code
t
Just saw that you already updated this in a new release. Thanks!
➕ 1
s
Thank you for the fix!