| import os |
| import gradio as gr |
| import markdown2 |
|
|
| |
| def foo(dir): |
| |
| return dir.name |
|
|
|
|
| def style_text(input_text): |
| first = markdown2.markdown(input_text) |
| styled_text = f'<span style="color: blue; background-color: yellow; font-weight: bold; font-style: italic;">{input_text}</span>' |
| return first + styled_text |
|
|
|
|
| |
|
|
| with gr.Blocks() as pinecone: |
| filein = gr.File(file_count="directory") |
| show_out = gr.Textbox() |
| show = gr.Button(value="Show") |
| show.click(fn=foo, inputs=filein, outputs=show_out, queue=False) |
| |
|
|
|
|
|
|
| |
| iface = gr.Interface(fn=style_text, inputs="text", outputs="html") |
| iface.launch() |
|
|
|
|