juliaannjose commited on
Commit
90928a3
·
1 Parent(s): bc10bbd

use loading spinner while downloading datasets

Browse files
Files changed (1) hide show
  1. app.py +14 -13
app.py CHANGED
@@ -1,22 +1,23 @@
1
  import streamlit as st
2
  from transformers import pipeline
3
- from datasets import load_dataset, Dataset, DatasetDict
4
 
5
  # load the dataset and
6
  # use the patent number, abstract and claim columns for UI
7
- dataset_dict = load_dataset(
8
- "HUPD/hupd",
9
- name="sample",
10
- data_files="https://huggingface.co/datasets/HUPD/hupd/blob/main/hupd_metadata_2022-02-22.feather",
11
- icpr_label=None,
12
- train_filing_start_date="2016-01-01",
13
- train_filing_end_date="2016-01-21",
14
- val_filing_start_date="2016-01-22",
15
- val_filing_end_date="2016-01-31",
16
- )
 
17
 
18
- # widget for selecting our finetuned langugae model
19
- language_model_path = "juliaannjose/finetuned_model"
20
 
21
  # pass the model to transformers pipeline - model selection component.
22
  classifier_model = pipeline(model=language_model_path)
 
1
  import streamlit as st
2
  from transformers import pipeline
3
+ from datasets import load_dataset
4
 
5
  # load the dataset and
6
  # use the patent number, abstract and claim columns for UI
7
+ with st.spinner("Setting up the app..."):
8
+ dataset_dict = load_dataset(
9
+ "HUPD/hupd",
10
+ name="sample",
11
+ data_files="https://huggingface.co/datasets/HUPD/hupd/blob/main/hupd_metadata_2022-02-22.feather",
12
+ icpr_label=None,
13
+ train_filing_start_date="2016-01-01",
14
+ train_filing_end_date="2016-01-21",
15
+ val_filing_start_date="2016-01-22",
16
+ val_filing_end_date="2016-01-31",
17
+ )
18
 
19
+ # widget for selecting our finetuned langugae model
20
+ language_model_path = "juliaannjose/finetuned_model"
21
 
22
  # pass the model to transformers pipeline - model selection component.
23
  classifier_model = pipeline(model=language_model_path)