require 'replicate' require 'base64' require "pry" Replicate.configure do |config| config.api_token = "r8_HD5VtCokZJGOtOCcAEELkbobSTGrzYd3alWPF" end model = Replicate.client.retrieve_model("tencentarc/gfpgan") version = model.latest_version Dir.glob("thogun/data/*.jpg") do |image| inputs = { img: IO.open(Base64.encode64(image), 'rb') { |f| f.read }, version: "v1.4", scale: 2 } puts version.predict(inputs) binding.pry end # prepare_training_images.rb:14:in `initialize': no implicit conversion of String into Integer (TypeError) # from prepare_training_images.rb:14:in `open' # from prepare_training_images.rb:14:in `block in
' # from :220:in `glob' # from prepare_training_images.rb:12:in `
'