Support `os.PathLike` output from models (#2388)
This commit updates two pieces of our file handling code to work
with `os.PathLike` objects.
1. When transforming the output into a data-structure suitable for
encoding in `make_encodable` we convert the `PathLike` into a
`pathlib.Path` instance.
2. When reading the file data from disk in `upload_files` we use
`open()` instead of `Path.open()`.
This provides broader support for path-like objects, particularly
the new replicate-python client which will return path-like objects
from the new `use()` helper.