Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -394,6 +394,18 @@ about_html = f'''
|
|
394 |
</body>
|
395 |
'''
|
396 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
|
398 |
with gr.Blocks() as demo:
|
399 |
text_input = gr.Textbox(label="Name")
|
|
|
394 |
</body>
|
395 |
'''
|
396 |
|
397 |
+
# Gradio code
|
398 |
+
def predict(text_input):
|
399 |
+
file_name = f"{datetime.utcnow().strftime('%s')}.html"
|
400 |
+
file_path = static_dir / file_name
|
401 |
+
print(file_path)
|
402 |
+
with open(file_path, "w") as f:
|
403 |
+
f.write(f"""<h2>Hello {text_input} </h2>
|
404 |
+
<h3>{file_name}</h3>
|
405 |
+
""")
|
406 |
+
|
407 |
+
return f'<a href="/static/{file_name}" target="_blank">{file_name}</a>'
|
408 |
+
|
409 |
|
410 |
with gr.Blocks() as demo:
|
411 |
text_input = gr.Textbox(label="Name")
|