ajitrajasekharan
commited on
Commit
•
d57b0b0
1
Parent(s):
7190b6a
Update app.py
Browse files
app.py
CHANGED
@@ -74,6 +74,7 @@ def run_test(sent,top_k,model_name):
|
|
74 |
start = None
|
75 |
global bert_tokenizer
|
76 |
global bert_model
|
|
|
77 |
if (bert_tokenizer is None):
|
78 |
bert_tokenizer, bert_model = load_bert_model(model_name)
|
79 |
with st.spinner("Computing"):
|
@@ -82,6 +83,7 @@ def run_test(sent,top_k,model_name):
|
|
82 |
res = get_bert_prediction(sent,top_k,model_name)
|
83 |
st.caption("Results in JSON")
|
84 |
st.json(res)
|
|
|
85 |
|
86 |
except Exception as e:
|
87 |
st.error("Some error occurred during prediction" + str(e))
|
@@ -139,6 +141,9 @@ try:
|
|
139 |
# run_test(option,top_k,model_name)
|
140 |
if (bert_tokenizer is None):
|
141 |
bert_tokenizer, bert_model = load_bert_model(model_name)
|
|
|
|
|
|
|
142 |
|
143 |
|
144 |
except Exception as e:
|
|
|
74 |
start = None
|
75 |
global bert_tokenizer
|
76 |
global bert_model
|
77 |
+
global display_container
|
78 |
if (bert_tokenizer is None):
|
79 |
bert_tokenizer, bert_model = load_bert_model(model_name)
|
80 |
with st.spinner("Computing"):
|
|
|
83 |
res = get_bert_prediction(sent,top_k,model_name)
|
84 |
st.caption("Results in JSON")
|
85 |
st.json(res)
|
86 |
+
display_container.write("results")
|
87 |
|
88 |
except Exception as e:
|
89 |
st.error("Some error occurred during prediction" + str(e))
|
|
|
141 |
# run_test(option,top_k,model_name)
|
142 |
if (bert_tokenizer is None):
|
143 |
bert_tokenizer, bert_model = load_bert_model(model_name)
|
144 |
+
|
145 |
+
display_container = st.container()
|
146 |
+
display_container.write("ajits test")
|
147 |
|
148 |
|
149 |
except Exception as e:
|