File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -114,8 +114,20 @@ def base64_encode_file(file: io.IOBase) -> str:
114114
115115
116116class FileOutput (httpx .SyncByteStream , httpx .AsyncByteStream ):
117+ """
118+ An object that can be used to read the contents of an output file
119+ created by running a Replicate model.
120+ """
121+
117122 url : str
123+ """
124+ The file URL.
125+ """
126+
118127 client : "Client"
128+ """
129+ A Replicate client used to download the file.
130+ """
119131
120132 def __init__ (self , url : str , client : "Client" ) -> None :
121133 self .url = url
@@ -147,6 +159,10 @@ def __str__(self) -> str:
147159
148160
149161def transform_output (value : Any , client : "Client" ) -> Any :
162+ """
163+ Transform the output of a prediction to a `FileOutput` object if it's a URL.
164+ """
165+
150166 def transform (obj : Any ) -> Any :
151167 if isinstance (obj , Mapping ):
152168 return {k : transform (v ) for k , v in obj .items ()}
You can’t perform that action at this time.
0 commit comments