When I create an app based on chatinterface in HF Space, I can call it normally on HF. However, when I import it with gr.load("ch-yi/demo_chatinterface", src="spaces") in another HF Space or in any Python environment, errors occur. The biggest issue is that the TextBox always returns None.
import gradio as gr
demo = gr.load("ch-yi/demo_chatinterface", src="spaces").launch()
Here is the code on HF Space.
import gradio as gr
def slow_echo(message, history, additional_1, additional_2, additional_3, additional_4):
for i in range(len(message)):
yield "You typed: " + message[: i+1] + f"\nAdditional: {additional_1}, {additional_2}, {additional_3}, {additional_4}"
with gr.Blocks() as app:
number = gr.Number(100)
text = gr.Textbox(value="test")
gr.ChatInterface(fn=slow_echo, additional_inputs=[number, text]).queue()
app.launch()
The extra output is due to my discovery that the additional parameters after gr.load start displaying from the fifth index, rather than the original third index.
Have you searched existing issues? 🔎
[X] I have searched and found no existing issues
Reproduction
import gradio as gr
demo = gr.load("ch-yi/demo_chatinterface", src="spaces").launch()
Describe the bug
When I create an app based on chatinterface in HF Space, I can call it normally on HF. However, when I import it with gr.load("ch-yi/demo_chatinterface", src="spaces") in another HF Space or in any Python environment, errors occur. The biggest issue is that the TextBox always returns None.
https://huggingface.co/spaces/ch-yi/demo_chatinterface
Invoke in that HF Space
Invoke using Python locally
Here is the code on HF Space.
The extra output is due to my discovery that the additional parameters after gr.load start displaying from the fifth index, rather than the original third index.
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio