kargaranamir commited on
Commit
5253665
1 Parent(s): 08f58ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -24,8 +24,8 @@ import os
24
 
25
  # Define a dictionary to map model choices to their respective paths
26
  model_paths = {
27
- "LID201": ["kargaranamir/LID201", 'model.bin'],
28
- "BIGLID": ["kargaranamir/BIGLID", 'model.bin'],
29
  # "FT176": ["kargaranamir/FT176", 'model.bin'],
30
  "NLLB": ["facebook/fasttext-language-identification", 'model.bin']
31
  }
@@ -123,7 +123,7 @@ def merge_function(input_sentence, selected_model):
123
 
124
  input_sentence = input_sentence.replace('\n', ' ')
125
 
126
- # Load the FastText language identification (BIGLID) model from Hugging Face Hub
127
  classifier = load_classifier(selected_model)
128
  class_names = remove_label_prefix_list(classifier.labels)
129
  class_names = np.sort(class_names)
@@ -142,7 +142,7 @@ def merge_function(input_sentence, selected_model):
142
 
143
  # Define the Gradio interface
144
  input_text = gr.Textbox(label="Input Text", value="J'ai visited la beautiful beach avec mes amis for a relaxing journée under the sun.")
145
- model_choice = gr.Radio(choices=["BIGLID", "LID201", "NLLB"], label="Select Model", value='BIGLID')
146
 
147
  output_explanation = gr.outputs.File(label="Explanation HTML")
148
 
 
24
 
25
  # Define a dictionary to map model choices to their respective paths
26
  model_paths = {
27
+ "OpenLID": ["kargaranamir/LID201", 'model.bin'],
28
+ "GlotLID": ["cis-lmu/glotlid", 'model.bin'],
29
  # "FT176": ["kargaranamir/FT176", 'model.bin'],
30
  "NLLB": ["facebook/fasttext-language-identification", 'model.bin']
31
  }
 
123
 
124
  input_sentence = input_sentence.replace('\n', ' ')
125
 
126
+ # Load the FastText language identification model from Hugging Face Hub
127
  classifier = load_classifier(selected_model)
128
  class_names = remove_label_prefix_list(classifier.labels)
129
  class_names = np.sort(class_names)
 
142
 
143
  # Define the Gradio interface
144
  input_text = gr.Textbox(label="Input Text", value="J'ai visited la beautiful beach avec mes amis for a relaxing journée under the sun.")
145
+ model_choice = gr.Radio(choices=["GlotLID", "OpenLID", "NLLB"], label="Select Model", value='GlotLID')
146
 
147
  output_explanation = gr.outputs.File(label="Explanation HTML")
148