File size: 784 Bytes
07c20ed 8c48bdb 07c20ed 822026f 14c191d f0f0c45 07c20ed 85366f6 8c48bdb 85366f6 8c48bdb 85366f6 943e122 07c20ed 08bb225 85366f6 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import os
import gradio as gr
import markdown2
#debug use
def foo(dir):
#return [d.name for d in 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
#pinecone = gr.Interface(fn=foo, inputs=gr.inputs.File(file_count="directory"), outputs="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)
#pinecone.launch()
iface = gr.Interface(fn=style_text, inputs="text", outputs="html")
iface.launch()
|