Skip to content

Iterative output example does not work #3330

Closed
@zhxgj

Description

@zhxgj

Describe the bug

Cannot run the iterative output example. Getting an error "Expecting value: line 1 column 1 (char 0)"

Is there an existing issue for this?

  • I have searched the existing issues

Reproduction

Python env

python3.8 -m venv venv && . venv/bin/activate
pip install gradio==3.19.1

Script

import gradio as gr
import time
import numpy as np

# define core fn, which returns a generator {steps} times before returning the image
def fake_diffusion(steps):
    for _ in range(steps):
        time.sleep(1)
        image = np.random.random((600, 600, 3))
        yield image
    image = "https://gradio-builds.s3.amazonaws.com/diffusion_image/cute_dog.jpg"
    yield image


demo = gr.Interface(fake_diffusion, inputs=gr.Slider(1, 10, 3), outputs="image")

# define queue - required for generators
demo.queue()

demo.launch(share=True)

Screenshot

image

Logs

No stack track of the error is printed, even if enabling debug=True

System Info

python 3.8.6
gradio==3.19.1

Severity

blocking all usage of gradio

Metadata

Metadata

Assignees

Labels

needs reproAwaiting full reproduction

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions