Spaces:
Runtime error
Runtime error
Delete params.py
Browse files
params.py
DELETED
|
@@ -1,25 +0,0 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
|
| 3 |
-
load_js = """
|
| 4 |
-
function(text_input, url_params) {
|
| 5 |
-
console.log(text_input, url_params);
|
| 6 |
-
const params = new URLSearchParams(window.location.search);
|
| 7 |
-
url_params = Object.fromEntries(params);
|
| 8 |
-
return [text_input, url_params]
|
| 9 |
-
}
|
| 10 |
-
"""
|
| 11 |
-
def predict(text, url_params):
|
| 12 |
-
mod_url=""
|
| 13 |
-
mod=gr.HTML("")
|
| 14 |
-
out = None
|
| 15 |
-
valid=gr.update(visible=False)
|
| 16 |
-
mod_url = url_params.get('url')
|
| 17 |
-
print (mod_url)
|
| 18 |
-
return ["" + text + "", mod_url]
|
| 19 |
-
with gr.Blocks() as app:
|
| 20 |
-
with gr.Row(visible=False):
|
| 21 |
-
text_input=gr.Textbox()
|
| 22 |
-
text_output=gr.Textbox()
|
| 23 |
-
url_params = gr.JSON({}, visible=True, label="")
|
| 24 |
-
app.load(fn=predict, inputs=[text_input,url_params], outputs=[text_output,text_input],_js=load_js)
|
| 25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|