streamlit-octostar-utils 0.2.5__tar.gz → 0.2.7a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/PKG-INFO +1 -1
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/pyproject.toml +1 -1
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/celery.py +22 -20
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/nifi.py +4 -2
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/nlp/language.py +1 -1
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/LICENSE +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/README.md +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/fastapi.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/combine_fields.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/entities_parser.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/generics.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/info.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/linkchart_functions.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/matches.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/parameters.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/rules.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/api_crafter/parser/signals.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/core/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/core/dict.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/core/filetypes.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/core/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/core/threading/key_queue.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/core/timestamp.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/nlp/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/nlp/ner.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/octostar/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/octostar/client.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/octostar/context.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/octostar/permissions.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/ontology/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/ontology/expand_entities.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/ontology/inheritance.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/ontology/validation.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/style/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/style/common.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/threading/async_task_manager.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/threading/session_callback_manager.py +0 -0
- {streamlit_octostar_utils-0.2.5 → streamlit_octostar_utils-0.2.7a1}/streamlit_octostar_utils/threading/session_state_hot_swapper.py +0 -0
@@ -304,26 +304,28 @@ class CeleryExecutor(object):
|
|
304
304
|
raise TimeoutError("Redis not ready after a long wait!")
|
305
305
|
self.redis_client.flushall()
|
306
306
|
for queue, queue_config in self.queue_config.items():
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
307
|
+
for slot in range(queue_config.n_workers):
|
308
|
+
worker_name = f"celery@{self.name}:{queue}:{slot}"
|
309
|
+
command = [
|
310
|
+
"env",
|
311
|
+
f"PYTHONPATH={os.getcwd()}",
|
312
|
+
f"CELERY_WORKER_QUEUES={queue}",
|
313
|
+
f"CELERY_WORKER_NAME={worker_name}",
|
314
|
+
"celery",
|
315
|
+
"--app",
|
316
|
+
f"{self.filename}.{self.name}",
|
317
|
+
"worker",
|
318
|
+
"--pool=prefork",
|
319
|
+
"--concurrency=1",
|
320
|
+
f"--loglevel={self.loglevel}",
|
321
|
+
f"-n {worker_name}",
|
322
|
+
]
|
323
|
+
if queue_config.max_tasks_per_child is not None:
|
324
|
+
command.append(f"--max-tasks-per-child={queue_config.max_tasks_per_child}")
|
325
|
+
if queue_config.max_memory_per_child is not None:
|
326
|
+
command.append(f"--max-memory-per-child={queue_config.max_memory_per_child}")
|
327
|
+
process = subprocess.Popen(command)
|
328
|
+
self.processes.append(process)
|
327
329
|
self.beat_process = subprocess.Popen(
|
328
330
|
[
|
329
331
|
"celery",
|
@@ -214,6 +214,8 @@ class NifiEntityProxy(object):
|
|
214
214
|
class NifiFragmenter(object):
|
215
215
|
def as_nifi_fragments(fragments, fragmenter_keylist):
|
216
216
|
count = len(fragments)
|
217
|
+
if count < 2:
|
218
|
+
raise ValueError("Must have at least 2 entities for fragmentation")
|
217
219
|
identifier = str(uuid.uuid4())
|
218
220
|
for i, entity in enumerate(fragments):
|
219
221
|
travel_dict(
|
@@ -289,10 +291,10 @@ class NifiContextManager(object):
|
|
289
291
|
def get_client(self, json_data):
|
290
292
|
all_jwts = [e["request"].get("jwt") for e in json_data]
|
291
293
|
all_jwts = [j for j in all_jwts if j]
|
292
|
-
assert len(set(all_jwts))
|
294
|
+
assert len(set(all_jwts)) <= 1 # jwt must be unique
|
293
295
|
all_ontology_names = [e["request"].get("ontology_name") for e in json_data]
|
294
296
|
all_ontology_names = [j for j in all_ontology_names if j]
|
295
|
-
assert len(set(all_ontology_names))
|
297
|
+
assert len(set(all_ontology_names)) <= 1 # ontology name must be unique
|
296
298
|
curr_user_jwt = all_jwts[0]
|
297
299
|
curr_user_ontology = all_ontology_names[0]
|
298
300
|
client = make_client(fixed_jwt=curr_user_jwt, ontology_name=curr_user_ontology)
|
@@ -9,7 +9,7 @@ def detect_language(text, min_confidence=None):
|
|
9
9
|
)
|
10
10
|
detected_lang, confidence = detector.classify(text)
|
11
11
|
if min_confidence and confidence < min_confidence:
|
12
|
-
return None
|
12
|
+
return None, confidence
|
13
13
|
detected_lang = re.sub("[^A-Za-z]", "", detected_lang).lower()
|
14
14
|
detected_lang = languages.to_name(detected_lang).lower()
|
15
15
|
return detected_lang, confidence
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|