internal-v0 / app.py
carlosh93's picture
adding queue system, rotate transformations, and scroll to the top when click on submit button
d5ac27c
raw
history blame
683 Bytes
# import spacy.cli
# spacy.cli.download("ja_core_news_sm")
# spacy.cli.download("zh_core_web_sm")
import os
os.environ["TF_USE_LEGACY_KERAS"] = "1"
import spacy_udpipe
spacy_udpipe.download("ja")
spacy_udpipe.download("zh")
from ui.layout import build_ui
from logic.data_utils import load_concepts, load_metadata
from config.settings import HF_API_TOKEN, HF_DATASET_NAME
concepts = load_concepts()
metadata = load_metadata()
demo = build_ui(concepts, metadata, HF_API_TOKEN, HF_DATASET_NAME)
demo.queue(max_size=50, default_concurrency_limit=5) # Enable queue system with max 30 requests
# demo.launch()
demo.launch(debug=False, server_port=7861)
demo.close()
# gr.close_all()