internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: fossasia/open-event-server

Issue:
API to verify password of signed in account
<img width="1437" alt="Screenshot 2023-07-13 at 2 37 01 AM" src="https://github.com/fossasia/open-event-server/assets/24926784/66b2a46e-5374-40ee-a072-30e7916948ff">

In the check-in web app, the sign-out button is locked behind a password verification modal. This is to prevent end users (eventgoers in this case) from signing out from a kiosk. A password verification API will be needed in this case to verify the password of the logged-in account. 


Discussion:

Resolving patch:
diff --git a/app/api/auth.py b/app/api/auth.py
--- a/app/api/auth.py
+++ b/app/api/auth.py
@@ -466,3 +466,30 @@ def decorated(*args, **kwargs):
 def environment_details():
     envdump = EnvironmentDump(include_config=False)
     return envdump.dump_environment()
+
+
+@auth_routes.route('/verify-password', methods=['POST'])
+@jwt_required
+def verify_password():
+    data = request.get_json()
+    password = data.get('password')
+
+    if not all([current_user.id, password]):
+        logging.error('user or password missing')
+        return jsonify(error='user or password missing'), 400
+
+    try:
+        user = User.query.filter_by(id=current_user.id).one()
+    except NoResultFound:
+        logging.info('User Not Found')
+        raise NotFoundError({'source': ''}, 'User Not Found')
+
+    result = False
+    if user.is_correct_password(password):
+        result = True
+
+    return jsonify(
+        {
+            "result": result,
+        }
+    )


Test patch:
diff --git a/tests/all/integration/api/helpers/test_auth.py b/tests/all/integration/api/helpers/test_auth.py
--- a/tests/all/integration/api/helpers/test_auth.py
+++ b/tests/all/integration/api/helpers/test_auth.py
@@ -56,3 +56,18 @@ def test_get_user_id(client, jwt):
 
     assert response.status_code == 200
     assert json.loads(response.data)['user_id']
+
+
+def test_verify_password(client, jwt):
+    """Method to test verify password"""
+    data = json.dumps({'password': 'password'})
+
+    response = client.post(
+        '/v1/auth/verify-password',
+        content_type='application/vnd.api+json',
+        headers=jwt,
+        data=data,
+    )
+
+    assert response.status_code == 200
+    assert json.loads(response.data)['result']
Repository: fossasia/open-event-server

Issue:
Email Confirmation to Create Account show {app_name} instead of showing actual app name
Email Confirmation to Create Account show {app_name} instead of showing actual app name set to "eventyay" in settings at https://eventyay.com/admin/settings.

![Screenshot from 2023-07-25 15-57-26](https://github.com/fossasia/open-event-server/assets/1583873/c05a27c6-8764-4846-a78d-11ef929c52af)



Discussion:

Resolving patch:
diff --git a/app/api/helpers/mail.py b/app/api/helpers/mail.py
--- a/app/api/helpers/mail.py
+++ b/app/api/helpers/mail.py
@@ -137,11 +137,12 @@ def send_email_with_action(user, action, template_name, bcc=None, **kwargs):
 def send_email_confirmation(email, link):
     """account confirmation"""
     action = MailType.USER_CONFIRM
+    app_name = get_settings()['app_name']
     mail = MAILS[action]
     send_email(
         to=email,
         action=action,
-        subject=mail['subject'],
+        subject=mail['subject'].format(app_name=app_name),
         html=render_template(mail['template'], email=email, link=link),
     )
 


Test patch:
Repository: fossasia/open-event-server

Issue:
Unable to get all stations from API
<!-- A clear and concise description of what the bug is. -->

**To Reproduce**
Steps to reproduce the behavior:
1) Call API from 'v1/events/{eventId}/stations)'
2) 'Internal Server Error' returned

<img width="1366" alt="Screenshot 2023-07-27 at 10 43 58 PM" src="https://github.com/fossasia/open-event-server/assets/131640457/52f26f89-9248-46ea-af4a-9bf1da922f9f">

**Expected behavior**
Receive JSON data of all stations for a particular event

**Additional details:**
 - OS: MacOS




Discussion:
https://github.com/fossasia/open-event-server/pull/8991
Hi @shaunBoahCodes 
I think that test environment has not migrated yet.
![image](https://github.com/fossasia/open-event-server/assets/135117837/af51283e-f329-4d96-8ba3-37fbb2076f28)

@lthanhhieu we are doing on test
![Uploading image.png…]()

Hi @cweitat , 
Can you check the database that has the table station or not? As I checked in test server, I could not find it, I am not sure if you have another server test or not.
@norbusan there's new database tables created. not sure if that was done

Resolving patch:
diff --git a/migrations/versions/rev-2023-07-19-10:01:32-3b784f9c98c7_.py b/migrations/versions/rev-2023-07-19-10:01:32-3b784f9c98c7_.py
--- a/migrations/versions/rev-2023-07-19-10:01:32-3b784f9c98c7_.py
+++ b/migrations/versions/rev-2023-07-19-10:01:32-3b784f9c98c7_.py
@@ -11,7 +11,7 @@
 
 # revision identifiers, used by Alembic.
 revision = '3b784f9c98c7'
-down_revision = '9881f067213b'
+down_revision = '2b19596af9f0'
 
 
 def upgrade():
diff --git a/migrations/versions/rev-2023-07-18-18:29:35-9881f067213b_.py b/migrations/versions/rev-2023-07-19-18:29:35-9881f067213b_.py
similarity index 94%
rename from migrations/versions/rev-2023-07-18-18:29:35-9881f067213b_.py
rename to migrations/versions/rev-2023-07-19-18:29:35-9881f067213b_.py
--- a/migrations/versions/rev-2023-07-18-18:29:35-9881f067213b_.py
+++ b/migrations/versions/rev-2023-07-19-18:29:35-9881f067213b_.py
@@ -1,7 +1,7 @@
 """empty message
 
 Revision ID: 9881f067213b
-Revises: f508644acbd3
+Revises: 3b784f9c98c7
 Create Date: 2023-07-18 18:29:35.835886
 
 """
@@ -12,7 +12,7 @@
 
 # revision identifiers, used by Alembic.
 revision = '9881f067213b'
-down_revision = '2b19596af9f0'
+down_revision = '3b784f9c98c7'
 
 
 def upgrade():
diff --git a/migrations/versions/rev-2023-07-20-10:58:04-4e6420d3dbc8_.py b/migrations/versions/rev-2023-07-20-10:58:04-4e6420d3dbc8_.py
--- a/migrations/versions/rev-2023-07-20-10:58:04-4e6420d3dbc8_.py
+++ b/migrations/versions/rev-2023-07-20-10:58:04-4e6420d3dbc8_.py
@@ -1,7 +1,7 @@
 """empty message
 
 Revision ID: 4e6420d3dbc8
-Revises: 3b784f9c98c7
+Revises: 9881f067213b
 Create Date: 2023-07-20 10:58:04.278543
 
 """
@@ -12,7 +12,7 @@
 
 # revision identifiers, used by Alembic.
 revision = '4e6420d3dbc8'
-down_revision = '3b784f9c98c7'
+down_revision = '9881f067213b'
 
 
 def upgrade():


Test patch:
Repository: fossasia/open-event-server

Issue:
allow mutiple station for same location
<!--
(Thanks for sending a pull request! Please make sure you click the link above to view the contribution guidelines, then fill out the blanks below.)
-->
<!-- Add the issue number that is fixed by this PR (In the form Fixes #123) -->

Fixes #8958 

#### Short description of what this resolves:
- fix issue to allow mutiple station for same location

#### Changes proposed in this pull request:

- allow mutiple station for same location

#### Checklist

- [x] I have read the [Contribution & Best practices Guide](https://blog.fossasia.org/open-source-developer-guide-and-best-practices-at-fossasia) and my PR follows them.
- [x] My branch is up-to-date with the Upstream `development` branch.
- [ ] The unit tests pass locally with my changes <!-- use `nosetests tests/` to run all the tests -->
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
<!-- If an existing function does not have a docstring, please add one -->
- [ ] All the functions created/modified in this PR contain relevant docstrings.



Discussion:

Resolving patch:
diff --git a/app/api/station.py b/app/api/station.py
--- a/app/api/station.py
+++ b/app/api/station.py
@@ -63,7 +63,7 @@ def before_patch(args, kwargs, data):
         if data.get('microlocation'):
             require_relationship(['microlocation'], data)
         else:
-            if data['station_type'] in ('check in', 'check out', 'daily'):
+            if data['station_type'] in ('check in', 'check out'):
                 raise ObjectNotFound(
                     {'parameter': 'microlocation'},
                     "Microlocation: microlocation_id is missing from your request.",
@@ -107,7 +107,7 @@ def before_post(args, kwargs, data):
         if data.get('microlocation'):
             require_relationship(['microlocation'], data)
         else:
-            if data['station_type'] in ('check in', 'check out', 'daily'):
+            if data['station_type'] in ('check in', 'check out'):
                 raise ObjectNotFound(
                     {'parameter': 'microlocation'},
                     "Microlocation: missing from your request.",


Test patch:
Repository: fossasia/open-event-server

Issue:
Add API docs for video interpretation / translation channels
The recently added translation video channels are not documented in the docs yet. Please add details into the API docs.


Discussion:

Resolving patch:
diff --git a/app/api/translation_channels.py b/app/api/translation_channels.py
--- a/app/api/translation_channels.py
+++ b/app/api/translation_channels.py
@@ -39,7 +39,7 @@ def query(self, view_kwargs):
             )
             return records
         else:
-            return None
+            return self.session.query(TranslationChannel)
 
     methods = ["GET"]
     schema = TranslationChannelSchema


Test patch:
diff --git a/tests/factories/translation_channel.py b/tests/factories/translation_channel.py
new file mode 100644
--- /dev/null
+++ b/tests/factories/translation_channel.py
@@ -0,0 +1,15 @@
+import factory
+
+from app.models.translation_channels import TranslationChannel
+from tests.factories import common
+from tests.factories.base import BaseFactory
+from tests.factories.video_stream import VideoStreamFactoryBase
+
+
+class TranslationChannelFactory(BaseFactory):
+    class Meta:
+        model = TranslationChannel
+
+    video_stream = factory.RelatedFactory(VideoStreamFactoryBase)
+    name = common.string_
+    url = common.url_
diff --git a/tests/hook_main.py b/tests/hook_main.py
--- a/tests/hook_main.py
+++ b/tests/hook_main.py
@@ -88,6 +88,8 @@
 from tests.all.integration.api.helpers.order.test_calculate_order_amount import (
     _create_taxed_tickets,
 )
+from tests.factories.translation_channel import TranslationChannelFactory
+from tests.factories.video_stream import VideoStreamFactoryBase
 
 stash = {}
 api_username = "open_event_test_user@fossasia.org"
@@ -5237,3 +5239,31 @@ def badge_export_pdf_get(transaction):
         )
         AttendeeFactory(ticket_id=1)
         db.session.commit()
+
+
+@hooks.before(
+    "Translation Channels > Translation Channels > List all Translation Channels"
+)
+def list_all_translation(transaction):
+    """
+    :param transaction:
+    :return:
+    """
+    with stash['app'].app_context():
+        video_stream = VideoStreamFactoryBase()
+        TranslationChannelFactory(video_stream=video_stream)
+        db.session.commit()
+
+
+@hooks.before(
+    "Translation Channels > Translation Channels > List all Translation Channels Of Video Stream"
+)
+def list_all_translation_of_video_stream(transaction):
+    """
+    :param transaction: transaction
+    :return:
+    """
+    with stash['app'].app_context():
+        video_stream = VideoStreamFactoryBase()
+        TranslationChannelFactory(video_stream=video_stream)
+        db.session.commit()
Repository: fossasia/open-event-server

Issue:
Refactor download PDF request due to unable to receieve on frontend
v1/badge-forms/print-badge-pdf?attendee_id=<id>&list_field_show=email+qr+custom_question

Print badge to convert from current POST with body to GET in URL to act as download link


Discussion:

Resolving patch:
diff --git a/app/api/custom/badge_forms.py b/app/api/custom/badge_forms.py
--- a/app/api/custom/badge_forms.py
+++ b/app/api/custom/badge_forms.py
@@ -3,7 +3,7 @@
 from flask_jwt_extended import jwt_required
 
 from app.api.helpers.badge_forms import create_preivew_badge_pdf
-from app.api.helpers.errors import ForbiddenError, NotFoundError
+from app.api.helpers.errors import ForbiddenError, NotFoundError, UnprocessableEntityError
 from app.api.helpers.export_helpers import (
     comma_separated_params_to_list,
     create_export_badge_job,
@@ -48,8 +48,14 @@ def print_badge_pdf():
         )
     attendee_id = request.args.get('attendee_id')
     list_field_show = comma_separated_params_to_list(request.args.get('list_field_show'))
-
-    ticket_holder = TicketHolder.query.filter_by(id=attendee_id).first()
+    if isinstance(attendee_id, int) or (
+        isinstance(attendee_id, str) and attendee_id.isdigit()
+    ):
+        ticket_holder = TicketHolder.query.filter_by(id=attendee_id).first()
+    else:
+        raise UnprocessableEntityError(
+            {'pointer': 'ticket_holder'}, "Invalid Attendee Id"
+        )
     if ticket_holder is None:
         raise NotFoundError(
             {'source': ''}, 'This ticket holder is not associated with any ticket'


Test patch:
Repository: fossasia/open-event-server

Issue:
Add the unique ticket code into the downlad CSV file
The CSV download file of the attendee list does not include the numbers on the QR Code. Please add this field "Ticket-ID".

The ticket ID has the following format: 135ccbd7-9b23-4a52-a7fd-326fec1b2c1c
Whereas the order has a format like this: #O1691408152-34896

![Screenshot from 2024-03-18 11-40-16](https://github.com/fossasia/open-event-server/assets/1583873/97568f6a-bd5a-4706-899f-64400c2f4da6)

Expected: The exported CSV should have a table column "Ticket ID" with the ticket ID number that is encoded in the QR code as well.

![Screenshot from 2024-03-18 11-48-30](https://github.com/fossasia/open-event-server/assets/1583873/be8e84dd-7088-4a71-8d03-a89d4414904e)



Discussion:
Hi @mariobehling

I have a query:
When will the ticket ID column data be generate? when the ticket is created by events or when the attendee purchasing the ticket?

Please help me confirm it. Thanks
> I have a query: When will the ticket ID column data be generate? when the ticket is created by events or when the attendee purchasing the ticket?
> 
> Please help me confirm it. Thanks

The CSV is generated when the user (organiser) clicks "Export as CSV". Into this CSV generation process one column ticket ID is missing.

As you can see in the screenshot below. The web UI already shows the ticket ID in the table column "Order". Every order has an order number (it can be several tickets in one order) and every ticket has a ticket ID (the long string that we see also in the table).

![Screenshot from 2024-03-19 10-17-44](https://github.com/fossasia/open-event-server/assets/1583873/27d1f7d8-3583-4a81-841a-29474653c697)



Currently the ticket ID and the QR code are 90% identical, but there is an additional number at the end of the ticket ID in the QR code which should not be there.

Ticket ID in download CSV: b8f78f85-b602-43dc-b639-fd2e5114de56
Ticket ID in QR code: b8f78f85-b602-43dc-b639-fd2e5114de56-960

![Screenshot from 2024-03-21 09-59-36](https://github.com/fossasia/open-event-server/assets/1583873/8556c32f-8387-4b2e-8704-90a1cf4d4ff1)

@lthanhhieu Please compare here: https://test.eventyay.com/orders/b8f78f85-b602-43dc-b639-fd2e5114de56/view
(This is an old ticket from you)

Resolving patch:
diff --git a/app/models/ticket_holder.py b/app/models/ticket_holder.py
--- a/app/models/ticket_holder.py
+++ b/app/models/ticket_holder.py
@@ -108,7 +108,7 @@ def qr_code(self):
             box_size=10,
             border=0,
         )
-        qr.add_data(self.order.identifier + "-" + str(self.id))
+        qr.add_data(self.order.identifier)
         qr.make(fit=True)
         img = qr.make_image()
 


Test patch:
Repository: microsoft/onnxscript

Issue:
Fix ge, le
Incorrect ops were used in #313 


Discussion:

Resolving patch:
diff --git a/onnxscript/function_libs/torch_aten/ops/core.py b/onnxscript/function_libs/torch_aten/ops/core.py
--- a/onnxscript/function_libs/torch_aten/ops/core.py
+++ b/onnxscript/function_libs/torch_aten/ops/core.py
@@ -1984,7 +1984,7 @@ def aten_gcd(self: TensorType, other: TensorType) -> TensorType:
 def aten_ge(self: TReal, other: TReal) -> BOOL:
     # ge.Tensor(Tensor self, Tensor other) -> Tensor
 
-    return op.Greater(self, other)
+    return op.GreaterOrEqual(self, other)
 
 
 def aten_geqrf(self: TensorType) -> tuple[TensorType, TensorType]:
@@ -2542,7 +2542,7 @@ def aten_ldexp(self: TensorType, other: TensorType) -> TensorType:
 def aten_le(self: TReal, other: TReal) -> BOOL:
     # le.Tensor(Tensor self, Tensor other) -> Tensor
 
-    return op.Less(self, other)
+    return op.LessOrEqual(self, other)
 
 
 def aten_lerp(self: TensorType, end: TensorType, weight: TensorType) -> TensorType:


Test patch:
Repository: microsoft/onnxscript

Issue:
ghpage: use the Furo theme
https://pradyunsg.me/furo/. It’s pretty and more modern. Used by black https://black.readthedocs.io/en/stable/#


Discussion:

Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -12,7 +12,7 @@
 # -- Project information -----------------------------------------------------
 
 project = "onnx-script"
-copyright = "2022, onnx"
+copyright = "2023, onnx"
 author = "onnx"
 version = onnxscript.__version__
 release = version
@@ -31,10 +31,11 @@
     "sphinx.ext.graphviz",
     "sphinx.ext.doctest",
     "sphinx.ext.napoleon",
+    "sphinx_copybutton",
 ]
 
 templates_path = ["_templates"]
-source_suffix = [".rst"]
+source_suffix = [".rst", ".md"]
 
 master_doc = "index"
 language = "en"
@@ -44,13 +45,12 @@
 # -- Options for HTML output -------------------------------------------------
 
 html_static_path = ["_static"]
-html_theme = "pydata_sphinx_theme"
+html_theme = "furo"
 html_theme_path = ["_static"]
 html_theme_options = {
-    "logo": {
-        "image_light": "logo-light.png",
-        "image_dark": "logo-dark.png",
-    }
+    "light_logo": "logo-light.png",
+    "dark_logo": "logo-dark.png",
+    "sidebar_hide_name": True,
 }
 html_css_files = ["css/custom.css"]
 
@@ -60,11 +60,6 @@
 
 # -- Options for intersphinx extension ---------------------------------------
 
-# Example configuration for intersphinx: refer to the Python standard library.
-intersphinx_mapping = {"https://docs.python.org/": None}
-
-# -- Options for Sphinx Gallery ----------------------------------------------
-
 intersphinx_mapping = {
     "python": (f"https://docs.python.org/{sys.version_info.major}", None),
     "matplotlib": ("https://matplotlib.org/", None),
@@ -72,6 +67,8 @@
     "onnxruntime": ("https://onnxruntime.ai/docs/api/python/", None),
 }
 
+# -- Options for Sphinx Gallery ----------------------------------------------
+
 sphinx_gallery_conf = {
     "examples_dirs": ["examples"],
     "gallery_dirs": ["auto_examples"],


Test patch:
Repository: microsoft/onnxscript

Issue:
Remove **kwargs in aten_embedding
Not supported by onnx script. We should add all positional args in the signature. 


Discussion:
@xiaowuhu could you help fix this? Thanks!
I will take this tomorrow.

Resolving patch:
diff --git a/onnxscript/function_libs/torch_aten/ops/core.py b/onnxscript/function_libs/torch_aten/ops/core.py
--- a/onnxscript/function_libs/torch_aten/ops/core.py
+++ b/onnxscript/function_libs/torch_aten/ops/core.py
@@ -1641,8 +1641,10 @@ def aten_einsum(
 def aten_embedding(
     weight: TTensor,
     indices: TTensor,
-    **_,
-) -> TTensor:
+    padding_idx: int = -1,
+    scale_grad_by_freq: bool = False,
+    sparse: bool = False,
+):  # pylint: disable=unused-argument
     # embedding(Tensor weight, Tensor indices, int padding_idx=-1, bool scale_grad_by_freq=False, bool sparse=False) -> Tensor
 
     return op.Gather(weight, indices)


Test patch:
diff --git a/onnxscript/tests/function_libs/torch_aten/ops_correctness_test.py b/onnxscript/tests/function_libs/torch_aten/ops_correctness_test.py
--- a/onnxscript/tests/function_libs/torch_aten/ops_correctness_test.py
+++ b/onnxscript/tests/function_libs/torch_aten/ops_correctness_test.py
@@ -179,6 +179,17 @@ def _cat_input_wrangler(
     return args, kwargs
 
 
+def _embedding_input_wrangler(
+    args: list[Any], kwargs: dict[str, Any]
+) -> tuple[list[Any], dict[str, Any]]:
+    """Remove arguments not present in the aten op signature."""
+    if "max_norm" in kwargs:
+        del kwargs["max_norm"]
+    if "norm_type" in kwargs:
+        del kwargs["norm_type"]
+    return args, kwargs
+
+
 def _full_input_wrangler(
     args: list[Any], kwargs: dict[str, Any]
 ) -> tuple[list[Any], dict[str, Any]]:
@@ -340,7 +351,7 @@ def _where_input_wrangler(
     "nn.functional.adaptive_avg_pool3d": nn_ops.aten_adaptive_avg_pool3d,
     "nn.functional.celu": nn_ops.aten_celu,
     "nn.functional.elu": nn_ops.aten_elu,
-    "nn.functional.embedding": core_ops.aten_embedding,
+    "nn.functional.embedding": (core_ops.aten_embedding, _embedding_input_wrangler),
     "nn.functional.leaky_relu": nn_ops.aten_leaky_relu,
     "nn.functional.logsigmoid": nn_ops.aten_log_sigmoid,
     "nn.functional.relu": nn_ops.aten_relu,
Repository: microsoft/onnxscript

Issue:
Fix domain for private functions
![image](https://user-images.githubusercontent.com/11205048/230641797-236b0385-9f4b-4889-beb1-bbe4c27153a1.png)



Discussion:

Resolving patch:
diff --git a/onnxscript/function_libs/torch_aten/ops/nn.py b/onnxscript/function_libs/torch_aten/ops/nn.py
--- a/onnxscript/function_libs/torch_aten/ops/nn.py
+++ b/onnxscript/function_libs/torch_aten/ops/nn.py
@@ -17,7 +17,6 @@
 import math
 from typing import Optional, Sequence
 
-import onnxscript
 from onnxscript import FLOAT, INT64
 from onnxscript.function_libs.torch_aten.registration import torch_op
 from onnxscript.function_libs.torch_aten.tensor_typing import (
@@ -1132,7 +1131,7 @@ def aten_rrelu_with_noise_backward(
     raise NotImplementedError()
 
 
-@onnxscript.script()
+@torch_op("aten::scaled_dot_product_attention", private=True)
 def _causal_attention_mask(query: TFloat, key: TFloat) -> TFloat:
     """Create a causal mask for the given query and key tensors.
 
@@ -1160,7 +1159,7 @@ def _causal_attention_mask(query: TFloat, key: TFloat) -> TFloat:
     return attn_mask
 
 
-@onnxscript.script()
+@torch_op("aten::scaled_dot_product_attention", private=True)
 def _attention_scale(query: TFloat) -> TFloat:
     """Calculate the scale factor for the attention result.
 


Test patch:
Repository: microsoft/onnxscript

Issue:
Fix attention logic when mask is bool
The logic for the dot attention when mask is bool is incorrect.


Discussion:

Resolving patch:
diff --git a/onnxscript/function_libs/torch_aten/ops/nn.py b/onnxscript/function_libs/torch_aten/ops/nn.py
--- a/onnxscript/function_libs/torch_aten/ops/nn.py
+++ b/onnxscript/function_libs/torch_aten/ops/nn.py
@@ -1661,6 +1661,8 @@ def _aten_scaled_dot_product_attention_bool_mask_onnx(
     # Scale q, k before matmul for stability see https://tinyurl.com/sudb9s96 for math
     query_scaled = op.Mul(query, op.Sqrt(scale))
     key_transposed_scaled = op.Mul(key_transposed, op.Sqrt(scale))
+    # Turn the Boolean mask to float: attn_mask.masked_fill(not attn_mask, -float('inf'))
+    attn_mask = op.Where(attn_mask, 0.0, op.Constant(value_float=-float("inf")))
     attn_weight = op.Softmax(
         op.Add(op.MatMul(query_scaled, key_transposed_scaled), attn_mask),
         axis=-1,


Test patch: