Gleb Gleb
commited on
Commit
·
b09d94b
1
Parent(s):
327bd85
fix
Browse files
app.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
-
import gradio as gr
|
| 2 |
-
from impresso_pipelines.solrnormalization import SolrNormalizationPipeline
|
| 3 |
import os
|
| 4 |
|
| 5 |
# Redirect cache to a writable path inside container
|
| 6 |
os.environ["XDG_CACHE_HOME"] = "/tmp/.cache"
|
| 7 |
|
|
|
|
|
|
|
| 8 |
|
| 9 |
pipeline = SolrNormalizationPipeline()
|
| 10 |
|
|
@@ -19,7 +19,6 @@ def normalize(text, lang_choice):
|
|
| 19 |
print("❌ Pipeline error:", e)
|
| 20 |
return f"Error: {e}"
|
| 21 |
|
| 22 |
-
|
| 23 |
demo = gr.Interface(
|
| 24 |
fn=normalize,
|
| 25 |
inputs=[
|
|
@@ -31,4 +30,4 @@ demo = gr.Interface(
|
|
| 31 |
description="Text normalization using Lucene analyzers. Language auto-detected if not selected."
|
| 32 |
)
|
| 33 |
|
| 34 |
-
demo.launch(server_name="0.0.0.0", server_port=7860)
|
|
|
|
|
|
|
|
|
|
| 1 |
import os
|
| 2 |
|
| 3 |
# Redirect cache to a writable path inside container
|
| 4 |
os.environ["XDG_CACHE_HOME"] = "/tmp/.cache"
|
| 5 |
|
| 6 |
+
import gradio as gr
|
| 7 |
+
from impresso_pipelines.solrnormalization import SolrNormalizationPipeline
|
| 8 |
|
| 9 |
pipeline = SolrNormalizationPipeline()
|
| 10 |
|
|
|
|
| 19 |
print("❌ Pipeline error:", e)
|
| 20 |
return f"Error: {e}"
|
| 21 |
|
|
|
|
| 22 |
demo = gr.Interface(
|
| 23 |
fn=normalize,
|
| 24 |
inputs=[
|
|
|
|
| 30 |
description="Text normalization using Lucene analyzers. Language auto-detected if not selected."
|
| 31 |
)
|
| 32 |
|
| 33 |
+
demo.launch(server_name="0.0.0.0", server_port=7860)
|