Spaces:
Sleeping
Sleeping
Update app.py
Browse files2 unmodified lines34567853 unmodified lines62636465666722 unmodified lines909192939495962 unmodified linesDoubles as a portfolio piece (preloaded contract clauses) and a sales tool(paste any documents and search them)."""import hashlibimport gradio as gr53 unmodified linesreturn _cache[key]def search(documents_text, query, top_k):docs = [d.strip() for d in (documents_text or "").split("\n\n") if d.strip()]if not docs:22 unmodified linesreturn "\n".join(out)with gr.Blocks(title="Semantic Document Search", theme=gr.themes.Soft()) as demo:gr.Markdown("""# 🔍 Semantic Document Search2 unmodified lines34567891053 unmodified lines6465666768697022 unmodified lines939495969798992 unmodified linesDoubles as a portfolio piece (preloaded contract clauses) and a sales tool(paste any documents and search them)."""import spaces # must be imported before torch / CUDA-touching packagesimport hashlibimport gradio as gr53 unmodified linesreturn _cache[key]@spaces.GPUdef search(documents_text, query, top_k):docs = [d.strip() for d in (documents_text or "").split("\n\n") if d.strip()]if not docs:22 unmodified linesreturn "\n".join(out)with gr.Blocks(title="Semantic Document Search") as demo:gr.Markdown("""# 🔍 Semantic Document Search
app.py+4-1