-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradio Streaming with Chat Interface with OpenAI: Expecting value: line 1 column 1 (char 0) #5371
Comments
Hi @XariZaru can you try a simpler example using queuing / streaming? For example, does this work for you? import gradio as gr
import numpy as np
import time
# 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() Also it would be helpful to know if this issue is related to your environment (with the proxies) or do you see the same behavior when you run on Colab, for example? |
I ran the above code in my Jupyter Notebook and the same error occurred. I will try in Colab next. |
Hi, it works on Colab, just not locally. |
Describe the bug
My Gradio app was working fine before I changed it to streaming. I am working on an OpenAI streaming chatbot concept and it keeps giving me an error. I've set up my proxy configuration as well since I work behind one.
Every time I send a message, an error pops up: Expecting value: line 1 column 1 (char 0)
No issue printed in console as well.
Have you searched existing issues? 🔎
Reproduction
This requires an OpenAI subscription and LLM that streams a response object. This could also be done with any other asynchronous request.
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio
The text was updated successfully, but these errors were encountered: