AshtonIsNotHere commited on
Commit
c4697a1
·
1 Parent(s): 9bfbb2e

Corrected XLM-roberta-base pipeline and integration

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -26,7 +26,7 @@ for model_name in name_list:
26
 
27
  #Manually add xlmr base
28
 
29
- xlmr_model = AutoModelForMaskedLM.from_pretrained(model_name, max_length=512)
30
  xlmr_tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base', max_length=512, truncation=True,)
31
  xlmr_p = pipeline("fill-mask", model=model, tokenizer=tokenizer)
32
 
@@ -40,7 +40,7 @@ def xlmr_base_fn(text):
40
 
41
  interfaces.append(gr.Interface(fn=xlmr_base_fn, inputs=gr.inputs.Textbox(lines=5,
42
  placeholder="Choose an example below, or add your own text with a single masked word, using <mask>."),
43
- outputs=gr.outputs.Label(label=model_name)))
44
 
45
  # Manually add longformer
46
  p = pipeline("fill-mask", model='allenai/longformer-base-4096')
 
26
 
27
  #Manually add xlmr base
28
 
29
+ xlmr_model = AutoModelForMaskedLM.from_pretrained('xlm-roberta-base', max_length=512)
30
  xlmr_tokenizer = AutoTokenizer.from_pretrained('xlm-roberta-base', max_length=512, truncation=True,)
31
  xlmr_p = pipeline("fill-mask", model=model, tokenizer=tokenizer)
32
 
 
40
 
41
  interfaces.append(gr.Interface(fn=xlmr_base_fn, inputs=gr.inputs.Textbox(lines=5,
42
  placeholder="Choose an example below, or add your own text with a single masked word, using <mask>."),
43
+ outputs=gr.outputs.Label(label='xlm-roberta-base')))
44
 
45
  # Manually add longformer
46
  p = pipeline("fill-mask", model='allenai/longformer-base-4096')