Skip to content

Commit

Permalink
Added Pytype None checks to run_inference.py
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 679607401
  • Loading branch information
tfx-copybara committed Sep 27, 2024
1 parent b430343 commit a3f25df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 46 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build.yml

This file was deleted.

2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

version: '3.1'

# We mount the TFX BSL project root at /build (which is the WORKDIR of the
# image) in the container.
services:
Expand Down
4 changes: 4 additions & 0 deletions tfx_bsl/beam/run_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,10 @@ def _run_inference(self, examples: List[InputType],
model) -> List[Mapping[Text, Any]]:
self._check_examples(examples)
body = {'instances': self._make_instances(examples, serialized_examples)}
if self._api_client is None:
raise ValueError(
'API client is not initialized. Call load_model() first.'
)
request = self._api_client.projects().predict(
name=self._full_model_name, body=body)
response = self._execute_request(request)
Expand Down

0 comments on commit a3f25df

Please sign in to comment.