Update app.py
Browse files
app.py
CHANGED
@@ -18,13 +18,13 @@ st.sidebar.write("Git Hub: https://github.com/TheAtticusProject/cuad")
|
|
18 |
st.sidebar.write("CUAD Dataset: https://huggingface.co/datasets/cuad")
|
19 |
st.sidebar.write("License: CC BY 4.0 https://creativecommons.org/licenses/by/4.0/")
|
20 |
|
21 |
-
@st.
|
22 |
def load_model():
|
23 |
model = AutoModelForQuestionAnswering.from_pretrained(model_checkpoint)
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint , use_fast=False)
|
25 |
return model, tokenizer
|
26 |
|
27 |
-
@st.
|
28 |
def load_questions():
|
29 |
with open('test.json') as json_file:
|
30 |
data = json.load(json_file)
|
@@ -36,7 +36,7 @@ def load_questions():
|
|
36 |
questions.append(question)
|
37 |
return questions
|
38 |
|
39 |
-
@st.
|
40 |
def load_contracts():
|
41 |
with open('test.json') as json_file:
|
42 |
data = json.load(json_file)
|
|
|
18 |
st.sidebar.write("CUAD Dataset: https://huggingface.co/datasets/cuad")
|
19 |
st.sidebar.write("License: CC BY 4.0 https://creativecommons.org/licenses/by/4.0/")
|
20 |
|
21 |
+
@st.cache_resource
|
22 |
def load_model():
|
23 |
model = AutoModelForQuestionAnswering.from_pretrained(model_checkpoint)
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint , use_fast=False)
|
25 |
return model, tokenizer
|
26 |
|
27 |
+
@st.cache_resource
|
28 |
def load_questions():
|
29 |
with open('test.json') as json_file:
|
30 |
data = json.load(json_file)
|
|
|
36 |
questions.append(question)
|
37 |
return questions
|
38 |
|
39 |
+
@st.cache_resource
|
40 |
def load_contracts():
|
41 |
with open('test.json') as json_file:
|
42 |
data = json.load(json_file)
|