Spaces:
Runtime error
Runtime error
wiki download option
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
from utils import load_hf_dataset, get_model_and_tokenizer, batch_embed
|
4 |
|
5 |
|
6 |
# TODO: add instructor models
|
@@ -48,7 +48,11 @@ def download(
|
|
48 |
):
|
49 |
if progress is not None:
|
50 |
progress(0.5, "Loading dataset...")
|
51 |
-
|
|
|
|
|
|
|
|
|
52 |
|
53 |
return f"Downloaded! It has {len(ds)} docs."
|
54 |
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
from utils import load_hf_dataset, get_model_and_tokenizer, batch_embed, download_wikipedia
|
4 |
|
5 |
|
6 |
# TODO: add instructor models
|
|
|
48 |
):
|
49 |
if progress is not None:
|
50 |
progress(0.5, "Loading dataset...")
|
51 |
+
|
52 |
+
if ds_name == "wikipedia":
|
53 |
+
ds = download_wikipedia(ds_name, ds_config)
|
54 |
+
else:
|
55 |
+
ds = load_hf_dataset(ds_name, ds_config, ds_split)
|
56 |
|
57 |
return f"Downloaded! It has {len(ds)} docs."
|
58 |
|