Spaces:
Runtime error
Runtime error
ashishraics
commited on
Commit
•
1948818
1
Parent(s):
859202b
update readme and mlm error fix
Browse files
app.py
CHANGED
@@ -216,10 +216,10 @@ def zs_mlm_task_selected(task,
|
|
216 |
# tokenizer_zs_mlm=AutoTokenizer.from_pretrained(zs_mlm_chkpt)
|
217 |
tokenizer_zs_mlm = AutoTokenizer.from_pretrained(zs_mlm_mdl_dir)
|
218 |
|
219 |
-
# create onnx model for zeroshot but once created locally comment it out.
|
220 |
-
create_onnx_model_zs_mlm(_model=model_zs_mlm,
|
221 |
-
|
222 |
-
|
223 |
|
224 |
# create inference session from onnx model
|
225 |
zs_session_mlm = ort.InferenceSession(f"{zs_mlm_onnx_mdl_dir}/{zs_mlm_onnx_mdl_name}", sess_options=session_options_ort)
|
@@ -235,11 +235,12 @@ if select_task=='README':
|
|
235 |
st.write(f"The current App deployed in Huggingface Space has {total_threads} CPU cores but only 1 is available per user so "
|
236 |
f"inference time will be on the higher side.")
|
237 |
st.markdown("---")
|
238 |
-
st.subheader("Info on Zeroshot Classification")
|
239 |
st.write("* It has been implemented using 2 novel approaches")
|
240 |
st.write("1. Using Natural Language Inference")
|
241 |
-
st.write("2. Using Masked language Model
|
242 |
-
st.write("
|
|
|
243 |
|
244 |
if select_task == 'Detect Sentiment':
|
245 |
t1=time.time()
|
|
|
216 |
# tokenizer_zs_mlm=AutoTokenizer.from_pretrained(zs_mlm_chkpt)
|
217 |
tokenizer_zs_mlm = AutoTokenizer.from_pretrained(zs_mlm_mdl_dir)
|
218 |
|
219 |
+
# # create onnx model for zeroshot but once created locally comment it out.
|
220 |
+
# create_onnx_model_zs_mlm(_model=model_zs_mlm,
|
221 |
+
# _tokenizer=tokenizer_zs_mlm,
|
222 |
+
# zs_mlm_onnx_mdl_dir=zs_mlm_onnx_mdl_dir)
|
223 |
|
224 |
# create inference session from onnx model
|
225 |
zs_session_mlm = ort.InferenceSession(f"{zs_mlm_onnx_mdl_dir}/{zs_mlm_onnx_mdl_name}", sess_options=session_options_ort)
|
|
|
235 |
st.write(f"The current App deployed in Huggingface Space has {total_threads} CPU cores but only 1 is available per user so "
|
236 |
f"inference time will be on the higher side.")
|
237 |
st.markdown("---")
|
238 |
+
st.subheader("Info on Zeroshot Text Classification")
|
239 |
st.write("* It has been implemented using 2 novel approaches")
|
240 |
st.write("1. Using Natural Language Inference")
|
241 |
+
st.write("2. Using Masked language Model")
|
242 |
+
st.write("Relevant Paper - https://paperswithcode.com/paper/zero-shot-text-classification-with-generative")
|
243 |
+
st.markdown()
|
244 |
|
245 |
if select_task == 'Detect Sentiment':
|
246 |
t1=time.time()
|