Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
|
|
2 |
from sentence_transformers import SentenceTransformer
|
3 |
import pandas as pd
|
4 |
import pickle
|
|
|
5 |
|
6 |
def make_clickable_both(val):
|
7 |
name, url = val.split('#')
|
@@ -63,9 +64,11 @@ def find(query):
|
|
63 |
#results = results.style.format({'text': make_clickable_both})
|
64 |
|
65 |
#return sorted_quran
|
66 |
-
|
|
|
|
|
67 |
|
68 |
-
demo = gr.Interface(fn=find, inputs="textbox", outputs=gr.Dataframe(headers=['sura', 'aya', 'text'],datatype=["str", "str", "markdown"],wrap=True))
|
69 |
#demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")
|
70 |
|
71 |
if __name__ == "__main__":
|
|
|
2 |
from sentence_transformers import SentenceTransformer
|
3 |
import pandas as pd
|
4 |
import pickle
|
5 |
+
from pathlib import Path
|
6 |
|
7 |
def make_clickable_both(val):
|
8 |
name, url = val.split('#')
|
|
|
64 |
#results = results.style.format({'text': make_clickable_both})
|
65 |
|
66 |
#return sorted_quran
|
67 |
+
filepath = Path('output.csv')
|
68 |
+
results.to_csv(filepath)
|
69 |
+
return results, filepath
|
70 |
|
71 |
+
demo = gr.Interface(fn=find, inputs="textbox", outputs=gr.Dataframe(headers=['sura', 'aya', 'text'],datatype=["str", "str", "markdown"],wrap=True),gr.DownloadButton())
|
72 |
#demo = gr.Interface(fn=find, inputs="textbox", outputs="textbox")
|
73 |
|
74 |
if __name__ == "__main__":
|