marme commited on
Commit
7bd7965
·
1 Parent(s): 8d098b8

add mirth/chonky_mmbert_small_multilingual_1

Browse files
Files changed (2) hide show
  1. app.py +2 -1
  2. chonky/__init__.py +1 -1
app.py CHANGED
@@ -10,7 +10,8 @@ def run(text, model_id):
10
  with gr.Blocks() as demo:
11
  gr.Markdown("# Semantic Chunking Demo\n **Note**: This Space runs on CPU only, so input is limited to max. 50000 characters.")
12
  model = gr.Dropdown(label="Choose model", value="mamei16/chonky_distilbert_base_uncased_1.1",
13
- choices=["mamei16/chonky_distilbert_base_uncased_1.1", "mirth/chonky_distilbert_base_uncased_1", "mirth/chonky_modernbert_base_1"])
 
14
  button = gr.Button("Run", variant="primary")
15
  text = gr.Textbox(label='Input Text', max_length=50000)
16
  gr.Markdown("## Result chunks:")
 
10
  with gr.Blocks() as demo:
11
  gr.Markdown("# Semantic Chunking Demo\n **Note**: This Space runs on CPU only, so input is limited to max. 50000 characters.")
12
  model = gr.Dropdown(label="Choose model", value="mamei16/chonky_distilbert_base_uncased_1.1",
13
+ choices=["mamei16/chonky_distilbert_base_uncased_1.1", "mirth/chonky_distilbert_base_uncased_1", "mirth/chonky_modernbert_base_1",
14
+ "mirth/chonky_mmbert_small_multilingual_1"])
15
  button = gr.Button("Run", variant="primary")
16
  text = gr.Textbox(label='Input Text', max_length=50000)
17
  gr.Markdown("## Result chunks:")
chonky/__init__.py CHANGED
@@ -34,7 +34,7 @@ class ParagraphSplitter:
34
  def __init__(self, model_id="mamei16/chonky_distilbert_base_uncased_1.1", device="cpu", model_cache_dir: str = None):
35
  super().__init__()
36
  self.device = device
37
- self.is_modernbert = model_id.startswith("mirth/chonky_modernbert")
38
 
39
  id2label = {
40
  0: "O",
 
34
  def __init__(self, model_id="mamei16/chonky_distilbert_base_uncased_1.1", device="cpu", model_cache_dir: str = None):
35
  super().__init__()
36
  self.device = device
37
+ self.is_modernbert = model_id.startswith("mirth/chonky_modernbert") or model_id == "mirth/chonky_mmbert_small_multilingual_1"
38
 
39
  id2label = {
40
  0: "O",