Spaces:
Running
Running
levanel commited on
Commit ·
5e299f7
1
Parent(s): f4bbcb0
removed __main__ && changed fp16->32
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import pypdf
|
|
| 6 |
from transformers import AutoTokenizer, AutoModel
|
| 7 |
#rando
|
| 8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
-
torch_dtype = torch.
|
| 10 |
|
| 11 |
print("Loading Sentence Encoder (Bi-Encoder Only)...")
|
| 12 |
embed_id = "sentence-transformers/all-MiniLM-L6-v2"
|
|
@@ -109,6 +109,4 @@ with gr.Blocks(title="Vecmini Visualizer") as demo:
|
|
| 109 |
process_btn.click(fn=process_pdf, inputs=pdf_input, outputs=status_out)
|
| 110 |
search_btn.click(fn=retrieve_chunks, inputs=[query_input, k_slider], outputs=results_out)
|
| 111 |
query_input.submit(fn=retrieve_chunks, inputs=[query_input, k_slider], outputs=results_out)
|
| 112 |
-
|
| 113 |
-
if __name__ == "__main__":
|
| 114 |
-
demo.launch()
|
|
|
|
| 6 |
from transformers import AutoTokenizer, AutoModel
|
| 7 |
#rando
|
| 8 |
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 9 |
+
torch_dtype = torch.float32
|
| 10 |
|
| 11 |
print("Loading Sentence Encoder (Bi-Encoder Only)...")
|
| 12 |
embed_id = "sentence-transformers/all-MiniLM-L6-v2"
|
|
|
|
| 109 |
process_btn.click(fn=process_pdf, inputs=pdf_input, outputs=status_out)
|
| 110 |
search_btn.click(fn=retrieve_chunks, inputs=[query_input, k_slider], outputs=results_out)
|
| 111 |
query_input.submit(fn=retrieve_chunks, inputs=[query_input, k_slider], outputs=results_out)
|
| 112 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|