Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -53,13 +53,11 @@ elif input_method == "Write or Paste New Text":
|
|
53 |
st.subheader("Text to Run")
|
54 |
input_text = st.text_area('Write or Paste Text Below', value="", height=128, max_chars=None, key=2)
|
55 |
|
56 |
-
@st.cache
|
57 |
def setModel(model_checkpoint, aggregation):
|
58 |
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint)
|
59 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
60 |
return pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy=aggregation)
|
61 |
-
|
62 |
-
@st.cache
|
63 |
def get_html(html: str):
|
64 |
WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem; margin-bottom: 2.5rem">{}</div>"""
|
65 |
html = html.replace("\n", " ")
|
|
|
53 |
st.subheader("Text to Run")
|
54 |
input_text = st.text_area('Write or Paste Text Below', value="", height=128, max_chars=None, key=2)
|
55 |
|
|
|
56 |
def setModel(model_checkpoint, aggregation):
|
57 |
model = AutoModelForTokenClassification.from_pretrained(model_checkpoint)
|
58 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
59 |
return pipeline('ner', model=model, tokenizer=tokenizer, aggregation_strategy=aggregation)
|
60 |
+
|
|
|
61 |
def get_html(html: str):
|
62 |
WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem; margin-bottom: 2.5rem">{}</div>"""
|
63 |
html = html.replace("\n", " ")
|