Spaces:
Sleeping
Sleeping
kargaranamir
commited on
v3 to v4.
Browse files
app.py
CHANGED
@@ -141,18 +141,18 @@ def merge_function(input_sentence, selected_model):
|
|
141 |
|
142 |
# Define the Gradio interface
|
143 |
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.")
|
144 |
-
model_choice = gr.Radio(choices=["GlotLID", "OpenLID", "NLLB"], label="Select Model",
|
145 |
|
146 |
-
output_explanation = gr.
|
147 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
148 |
|
149 |
-
|
150 |
-
iface = gr.Interface(merge_function,
|
151 |
-
inputs=[input_text, model_choice],
|
152 |
-
outputs=[gr.Image(type="pil", height=364, width=683, label = "Explanation Image"), output_explanation],
|
153 |
-
title="LIME LID",
|
154 |
-
description="This code applies LIME (Local Interpretable Model-Agnostic Explanations) on fasttext language identification.",
|
155 |
-
allow_flagging='never',
|
156 |
-
theme=gr.themes.Soft())
|
157 |
-
|
158 |
iface.launch()
|
|
|
141 |
|
142 |
# Define the Gradio interface
|
143 |
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.")
|
144 |
+
model_choice = gr.Radio(choices=["GlotLID", "OpenLID", "NLLB"], label="Select Model", value='GlotLID')
|
145 |
|
146 |
+
output_explanation = gr.File(label="Explanation HTML")
|
147 |
|
148 |
+
iface = gr.Interface(
|
149 |
+
fn=merge_function,
|
150 |
+
inputs=[input_text, model_choice],
|
151 |
+
outputs=[gr.Image(type="pil", height=364, width=683, label="Explanation Image"), output_explanation],
|
152 |
+
title="LIME LID",
|
153 |
+
description="This code applies LIME (Local Interpretable Model-Agnostic Explanations) on fasttext language identification.",
|
154 |
+
allow_flagging='never',
|
155 |
+
theme=gr.themes.Soft()
|
156 |
+
)
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
iface.launch()
|