ola13 commited on
Commit
e518449
1 Parent(s): e69d4c6

Upload with huggingface_hub

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
.gitattributes CHANGED
@@ -1,34 +1 @@
1
- *.7z filter=lfs diff=lfs merge=lfs -text
2
- *.arrow filter=lfs diff=lfs merge=lfs -text
3
- *.bin filter=lfs diff=lfs merge=lfs -text
4
- *.bz2 filter=lfs diff=lfs merge=lfs -text
5
- *.ckpt filter=lfs diff=lfs merge=lfs -text
6
- *.ftz filter=lfs diff=lfs merge=lfs -text
7
- *.gz filter=lfs diff=lfs merge=lfs -text
8
- *.h5 filter=lfs diff=lfs merge=lfs -text
9
- *.joblib filter=lfs diff=lfs merge=lfs -text
10
- *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
- *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
- *.model filter=lfs diff=lfs merge=lfs -text
13
- *.msgpack filter=lfs diff=lfs merge=lfs -text
14
- *.npy filter=lfs diff=lfs merge=lfs -text
15
- *.npz filter=lfs diff=lfs merge=lfs -text
16
- *.onnx filter=lfs diff=lfs merge=lfs -text
17
- *.ot filter=lfs diff=lfs merge=lfs -text
18
- *.parquet filter=lfs diff=lfs merge=lfs -text
19
- *.pb filter=lfs diff=lfs merge=lfs -text
20
- *.pickle filter=lfs diff=lfs merge=lfs -text
21
- *.pkl filter=lfs diff=lfs merge=lfs -text
22
- *.pt filter=lfs diff=lfs merge=lfs -text
23
- *.pth filter=lfs diff=lfs merge=lfs -text
24
- *.rar filter=lfs diff=lfs merge=lfs -text
25
- *.safetensors filter=lfs diff=lfs merge=lfs -text
26
- saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
- *.tar.* filter=lfs diff=lfs merge=lfs -text
28
- *.tflite filter=lfs diff=lfs merge=lfs -text
29
- *.tgz filter=lfs diff=lfs merge=lfs -text
30
- *.wasm filter=lfs diff=lfs merge=lfs -text
31
- *.xz filter=lfs diff=lfs merge=lfs -text
32
- *.zip filter=lfs diff=lfs merge=lfs -text
33
- *.zst filter=lfs diff=lfs merge=lfs -text
34
- *tfevents* filter=lfs diff=lfs merge=lfs -text
 
1
+ index/**/* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
README.md CHANGED
@@ -1,12 +1,13 @@
1
  ---
2
- title: Imdb Search
3
- emoji:
4
- colorFrom: indigo
5
- colorTo: purple
6
  sdk: gradio
7
- sdk_version: 3.18.0
8
  app_file: app.py
9
  pinned: false
 
10
  ---
11
 
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: IMDB search
3
+ emoji: 🐠
4
+ colorFrom: blue
5
+ colorTo: blue
6
  sdk: gradio
7
+ sdk_version: 3.12.0
8
  app_file: app.py
9
  pinned: false
10
+ license: apache-2.0
11
  ---
12
 
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from datasets import load_dataset
3
+ from pyserini.search.lucene import LuceneSearcher
4
+
5
+ searcher = LuceneSearcher("index")
6
+ ds = load_dataset("imdb", split="train")
7
+
8
+ def search(query):
9
+ hits = searcher.search(query, k=10)
10
+ results = ds.select([int(hit.docid) for hit in hits])
11
+ return results['text']
12
+
13
+
14
+ if __name__ == "__main__":
15
+ demo = gr.Blocks()
16
+
17
+ with demo:
18
+ with gr.Row():
19
+ gr.Markdown(value="""# <p style="text-align: center;"> IMDB search </p>""")
20
+ with gr.Row():
21
+ query = gr.Textbox(lines=1, max_lines=1, placeholder="Search…", label="Query")
22
+ with gr.Row():
23
+ submit_btn = gr.Button("🔍")
24
+ with gr.Column():
25
+ c1 = gr.HTML(label="Results")
26
+ c2 = gr.HTML(label="Results")
27
+ c3 = gr.HTML(label="Results")
28
+ c4 = gr.HTML(label="Results")
29
+ c5 = gr.HTML(label="Results")
30
+ c6 = gr.HTML(label="Results")
31
+ c7 = gr.HTML(label="Results")
32
+ c8 = gr.HTML(label="Results")
33
+ c9 = gr.HTML(label="Results")
34
+ c10 = gr.HTML(label="Results")
35
+ query.submit(fn=search, inputs=[query], outputs=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10])
36
+ submit_btn.click(search, inputs=[query], outputs=[c1, c2, c3, c4, c5, c6, c7, c8, c9, c10])
37
+
38
+ demo.launch(enable_queue=True, debug=True)
index/.gitkeep ADDED
File without changes
index/_c.fdm ADDED
Binary file (158 Bytes). View file
 
index/_c.fdt ADDED
Binary file (36.5 kB). View file
 
index/_c.fdx ADDED
Binary file (93 Bytes). View file
 
index/_c.fnm ADDED
Binary file (322 Bytes). View file
 
index/_c.nvd ADDED
Binary file (6.37 kB). View file
 
index/_c.nvm ADDED
Binary file (103 Bytes). View file
 
index/_c.si ADDED
Binary file (498 Bytes). View file
 
index/_c_Lucene90_0.doc ADDED
Binary file (927 kB). View file
 
index/_c_Lucene90_0.dvd ADDED
Binary file (38.2 kB). View file
 
index/_c_Lucene90_0.dvm ADDED
Binary file (171 Bytes). View file
 
index/_c_Lucene90_0.pos ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f4ac8c1c910a978617aa54300a6c2421ab1295ad8fd3a28da9eca9ffec36948d
3
+ size 1240149
index/_c_Lucene90_0.tim ADDED
Binary file (311 kB). View file
 
index/_c_Lucene90_0.tip ADDED
Binary file (8.41 kB). View file
 
index/_c_Lucene90_0.tmd ADDED
Binary file (263 Bytes). View file
 
index/_d.fdm ADDED
Binary file (157 Bytes). View file
 
index/_d.fdt ADDED
Binary file (36.4 kB). View file
 
index/_d.fdx ADDED
Binary file (93 Bytes). View file
 
index/_d.fnm ADDED
Binary file (322 Bytes). View file
 
index/_d.nvd ADDED
Binary file (6.29 kB). View file
 
index/_d.nvm ADDED
Binary file (103 Bytes). View file
 
index/_d.si ADDED
Binary file (498 Bytes). View file
 
index/_d_Lucene90_0.doc ADDED
Binary file (937 kB). View file
 
index/_d_Lucene90_0.dvd ADDED
Binary file (37.9 kB). View file
 
index/_d_Lucene90_0.dvm ADDED
Binary file (171 Bytes). View file
 
index/_d_Lucene90_0.pos ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf1185b23dfe7d554487554e5b731375c22821508fcf8781aec15d0899984efa
3
+ size 1262499
index/_d_Lucene90_0.tim ADDED
Binary file (314 kB). View file
 
index/_d_Lucene90_0.tip ADDED
Binary file (8.64 kB). View file
 
index/_d_Lucene90_0.tmd ADDED
Binary file (257 Bytes). View file
 
index/_e.fdm ADDED
Binary file (158 Bytes). View file
 
index/_e.fdt ADDED
Binary file (35.6 kB). View file
 
index/_e.fdx ADDED
Binary file (83 Bytes). View file
 
index/_e.fnm ADDED
Binary file (322 Bytes). View file
 
index/_e.nvd ADDED
Binary file (6.18 kB). View file
 
index/_e.nvm ADDED
Binary file (103 Bytes). View file
 
index/_e.si ADDED
Binary file (498 Bytes). View file
 
index/_e_Lucene90_0.doc ADDED
Binary file (917 kB). View file
 
index/_e_Lucene90_0.dvd ADDED
Binary file (37.3 kB). View file
 
index/_e_Lucene90_0.dvm ADDED
Binary file (171 Bytes). View file
 
index/_e_Lucene90_0.pos ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4ccaee5e5633b5c35ba7045c5e12e692587380d32c3020b81bac24a28da69ca2
3
+ size 1238216
index/_e_Lucene90_0.tim ADDED
Binary file (309 kB). View file
 
index/_e_Lucene90_0.tip ADDED
Binary file (8.29 kB). View file
 
index/_e_Lucene90_0.tmd ADDED
Binary file (258 Bytes). View file
 
index/_f.fdm ADDED
Binary file (158 Bytes). View file
 
index/_f.fdt ADDED
Binary file (36.7 kB). View file
 
index/_f.fdx ADDED
Binary file (93 Bytes). View file
 
index/_f.fnm ADDED
Binary file (322 Bytes). View file