Last active
November 21, 2022 21:16
-
-
Save geoffreyangus/4e0ecf9c6718170664efd7e0600fb61f to your computer and use it in GitHub Desktop.
Method 1: Using the `InferenceModule` Class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pprint import pprint | |
import pandas as pd | |
from ludwig.models.inference import InferenceModule | |
inference_module = InferenceModule.from_directory( | |
f"{EXPERIMENT_DIRECTORY}/torchscript") | |
input_df = pd.read_parquet(f"{DATA_DIRECTORY}/twitter_bots.parquet") | |
input_sample_df = input_df.head(2) | |
postproc_output, _ = inference_module.predict(input_sample_df, return_type=dict) | |
pprint(postproc_output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment