different behaviour between desktop VSCode and code-server using gradio app

In the context of a workshop, I'll be using a piece of code involving a gradio app. The minimal code I have with the issue is the following:
import gradio as gr

def handleAudio(audio):
pass

input_audio = gr.Audio(
sources=['upload', 'microphone'],
type='filepath'
)

demo = gr.Interface(
fn=handleAudio,
inputs=input_audio,
outputs="text",
allow_flagging="never"
)

demo.launch()
import gradio as gr

def handleAudio(audio):
pass

input_audio = gr.Audio(
sources=['upload', 'microphone'],
type='filepath'
)

demo = gr.Interface(
fn=handleAudio,
inputs=input_audio,
outputs="text",
allow_flagging="never"
)

demo.launch()
The result is the screenshot without every element (mainly lack of css) from code-server and the second one is what I have with desktop VSCode used. The browser console shows 2 requests with a status NS_ERROR_CORRUPTED_CONTENT and those are 2 css files (generated on the fly by gradio) Any clue on why this behaves properly in desktop mode and not code-server mode?
No description
No description
7 Replies
Codercord
Codercord3w ago
<#1305931637183352943>
Category
Help needed
Product
Coder OSS (v2)
Platform
Linux
Logs
Please post any relevant logs/error messages.
Phorcys
Phorcys3w ago
hey @TitiMoby, this is probably due to the fact that code-server uses path-based reverse proxying whereas Coder is using wildcard, which means that your app is probably looking at content placed at /<content> rather than at /<proxy subpath>/<content>
TitiMoby
TitiMobyOP3w ago
That’s what I’m  looking for. But I saw a lot of routes properly served. And I don’t blame coder itself, there is some magic in Gradio to serve a front end from backend code. I am currently experimenting with streamlit to see if I have a better result. The idea is to know what I can do in data science workshops
Phorcys
Phorcys3w ago
i'll try to reproduce it on my end in a moment with apps like these there is usually a setting to either change the base path or make it dynamic
TitiMoby
TitiMobyOP3w ago
If you need I also implemented serving with uvicorn that allows more control due to time constraint, we are going to use a trick from gradio which host temporary our app. I'll get back but it will imply to understand how the internals of Gradio works which is... /close
Phorcys
Phorcys3w ago
sounds good!
Codercord
Codercord3w ago
@Phorcys closed the thread.
Want results from more Discord servers?
Add your server