cog
cog copied to clipboard
Failure to return files without output_file_prefix
I don't have "A base URL to upload output files to. src" How can I possibly retrieve the file as a response?
I used the example here
from cog import BasePredictor, File, Input, Path
from PIL import Image
class Predictor(BasePredictor):
def predict(self, source_image: File = Input(description="Image to enlarge")) -> File:
pillow_img = Image.open(source_image)
upscaled_image = do_some_processing(pillow_img)
return File(upscaled_image)
Building is successful but the predict function produces the following error:-
ⅹ /predictions call returned status 500
Hi, @Medoalmasry I'm also getting the same error. Have you found any solution? Thanks
Indeed, File() does not seem to accept parameters. My approach is to return a Path instead of a File, but I can't say I'm having great success either. It would be nice to update the documentation for File with an example that works.