Skip to content

Commit

Permalink
Address CI and review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yuslepukhin committed Oct 21, 2024
1 parent bdd1938 commit c48ff4c
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
5 changes: 4 additions & 1 deletion src/csharp/Adapters.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Microsoft.ML.OnnxRuntimeGenAI;
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using Microsoft.ML.OnnxRuntimeGenAI;
using System;
using System.Runtime.InteropServices;

Expand Down
1 change: 0 additions & 1 deletion src/csharp/Exceptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Collections.Generic;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
1 change: 0 additions & 1 deletion src/csharp/MultiModalProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
1 change: 0 additions & 1 deletion src/csharp/Result.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
1 change: 0 additions & 1 deletion src/csharp/Sequences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
1 change: 0 additions & 1 deletion src/csharp/Tensor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

using System;
using System.Diagnostics;
using System.Runtime.InteropServices;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
2 changes: 0 additions & 2 deletions src/csharp/Tokenizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
1 change: 0 additions & 1 deletion src/csharp/TokenizerStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;

namespace Microsoft.ML.OnnxRuntimeGenAI
{
Expand Down
1 change: 0 additions & 1 deletion src/csharp/Utils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the MIT License.

using System;
using System.Runtime.InteropServices;
using System.Text;

namespace Microsoft.ML.OnnxRuntimeGenAI
Expand Down
14 changes: 10 additions & 4 deletions test/python/test_onnxruntime_genai_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,14 +434,20 @@ def _prepare_adapter_model(test_data_path):
model.graph.input.extend([adapter_a, adapter_b])

# tensor proto for default lora parameter A
adapter_weight_a = np.zeros([vocab_size], dtype=np.float32)
adapter_weight_a = np.zeros([vocab_size], dtype=(np.float32 if device == "cpu" else np.float16))
adapter_weight_a_tensor = onnx.helper.make_tensor(
"adapter_a", onnx.TensorProto.FLOAT, [vocab_size], adapter_weight_a.flatten()
"adapter_a",
onnx.TensorProto.FLOAT if device == "cpu" else onnx.TensorProto.FLOAT16,
[vocab_size],
adapter_weight_a.flatten()
)

adapter_weight_b = np.zeros([vocab_size], dtype=np.float32)
adapter_weight_b = np.zeros([vocab_size], dtype=(np.float32 if device == "cpu" else np.float16))
adapter_weight_b_tensor = onnx.helper.make_tensor(
"adapter_b", onnx.TensorProto.FLOAT, [vocab_size], adapter_weight_b.flatten()
"adapter_b",
onnx.TensorProto.FLOAT if device == "cpu" else onnx.TensorProto.FLOAT16,
[vocab_size],
adapter_weight_b.flatten()
)

model.graph.initializer.extend([adapter_weight_a_tensor, adapter_weight_b_tensor])
Expand Down

0 comments on commit c48ff4c

Please sign in to comment.