send base64 via gradio

#8
by deepnothing - opened

is there any way to send an image to this model as base64, something like this?:

    const imageBuffer = fs.readFileSync(imagePath);
    const base64Image = imageBuffer.toString("base64");

    const client = await Client.connect("prithivMLmods/Multimodal-OCR");
    const result = await client.predict("/chat", {
      input_dict: {
        text: "Describe this image",
        files: [`data:image/png;base64,${base64Image}`],
      },
      use_rolmocr: true,
    });```

Yes, it's possible to convert a Base64 string to an image and send it to the model. For the conversion implementation refer the page.
https://github.com/PRITHIVSAKTHIUR/Base64-to-Image-Encode

Thank you but it seems like this is for adding that conversion capability to the UI. I am looking to send base64 or file through the gradio client api. Do you know if this is possible?

Sorry for the late reply. I'll add Base64 input support soon, so you can access it via the Gradio client and make use of it. Thank you!
@deepnothing

Sign up or log in to comment