mirror of
https://github.com/NandhaKishorM/laya.git
synced 2026-09-28 16:02:56 +08:00
release: bump version to 0.3.5 and add all test suites to CI/release workflows
This commit is contained in:
@@ -47,6 +47,8 @@ jobs:
|
||||
python tests/test_criteria.py
|
||||
python tests/test_download.py
|
||||
python tests/test_shortlist.py
|
||||
python tests/test_decision_model.py
|
||||
python tests/test_packaging.py
|
||||
|
||||
- name: Email cleaning tests
|
||||
run: python tests/test_email.py
|
||||
|
||||
@@ -40,6 +40,10 @@ jobs:
|
||||
python tests/test_router.py
|
||||
python tests/test_criteria.py
|
||||
python tests/test_email.py
|
||||
python tests/test_download.py
|
||||
python tests/test_shortlist.py
|
||||
python tests/test_decision_model.py
|
||||
python tests/test_packaging.py
|
||||
|
||||
- name: Build
|
||||
run: python -m build
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ from .presets import (
|
||||
from .router import DEFAULT_MODELS, RouteDecision, Router
|
||||
from .shortlist import embed_fn_from_agent, predict_shortlist, shortlist_choice
|
||||
|
||||
__version__ = "0.3.4"
|
||||
__version__ = "0.3.5"
|
||||
__all__ = [
|
||||
"Agent",
|
||||
"RLAgent",
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "laya"
|
||||
version = "0.3.4"
|
||||
version = "0.3.5"
|
||||
description = "Fast, non-autoregressive System 1 decision engine with calibrated probabilities"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
|
||||
@@ -4,9 +4,13 @@ Uses a tiny from-config BERT encoder (no pretrained weights downloaded) so
|
||||
these run fast and offline, unlike tests/test_local_e2e.py which needs a
|
||||
real checkpoint on disk.
|
||||
"""
|
||||
import os
|
||||
import sys
|
||||
import torch
|
||||
from transformers import AutoConfig, AutoModel
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
from laya.common import DecisionModel
|
||||
|
||||
|
||||
@@ -85,7 +89,13 @@ def test_multi_option_question_is_unaffected():
|
||||
)
|
||||
with torch.no_grad():
|
||||
logits, act_logits = model(input_ids, attention_mask, marker_pos, marker_mask, qtype)
|
||||
assert logits.shape == (2, 4)
|
||||
assert act_logits.shape == (2, 2)
|
||||
assert torch.isfinite(logits).all()
|
||||
assert torch.isfinite(act_logits).all()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_single_option_question_does_not_crash()
|
||||
test_single_option_top1_minus_top2_is_exactly_one()
|
||||
test_multi_option_question_is_unaffected()
|
||||
print("all decision model tests passed")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user