olumideola commited on
Commit
d9de3ef
·
verified ·
1 Parent(s): 5fbc2ec

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -77,7 +77,7 @@ def detect_language(text: str, model_label: str, progress=gr.Progress()):
77
  if not text or not text.strip():
78
  return "Please enter some text."
79
 
80
- progress(0.2, desc=f"Loading {model_label}..." if model_label not in _PIPELINE_CACHE else "Running...")
81
  try:
82
  pipe = get_pipeline(model_label)
83
  except Exception as e:
@@ -129,7 +129,7 @@ def compare_all(text: str, progress=gr.Progress()):
129
  return "\n\n".join(sections)
130
 
131
 
132
- with gr.Blocks(theme=gr.themes.Soft()) as demo:
133
  gr.Markdown("""
134
  # 🇳🇬 Nigerian & Multilingual Language Identifier
135
  All language-identification models by [olaverse](https://huggingface.co/olaverse), in one Space.
@@ -194,4 +194,4 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
194
  """)
195
 
196
  if __name__ == "__main__":
197
- demo.launch()
 
77
  if not text or not text.strip():
78
  return "Please enter some text."
79
 
80
+ progress(0.2, desc="Running..." if _CACHED_LABEL == model_label else f"Loading {model_label}...")
81
  try:
82
  pipe = get_pipeline(model_label)
83
  except Exception as e:
 
129
  return "\n\n".join(sections)
130
 
131
 
132
+ with gr.Blocks() as demo:
133
  gr.Markdown("""
134
  # 🇳🇬 Nigerian & Multilingual Language Identifier
135
  All language-identification models by [olaverse](https://huggingface.co/olaverse), in one Space.
 
194
  """)
195
 
196
  if __name__ == "__main__":
197
+ demo.launch(theme=gr.themes.Soft())