Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix c# demo project to new onnx model files #1689

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dogvane
Copy link

@dogvane dogvane commented May 5, 2024

  1. 修改模型加载代码,适配新的模型文件名。

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@LauraGPT LauraGPT requested a review from manyeyes May 6, 2024 14:15
@@ -9,9 +9,20 @@
using Microsoft.ML.OnnxRuntime.Tensors;
using Microsoft.Extensions.Logging;
using System.Text.RegularExpressions;
using Newtonsoft.Json.Linq;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

从实现意图上看,引入Newtonsoft.Json的目的是为了兼容json格式的tokens文件,建议这里迁移至System.Text.Json。
另一种解决方法,可以通过实现一个“转换器”方法,作为前置工具,将json格式的tokens文件统一转换为txt。
这将提高运行效率,以及减小库发布后的体积。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但是从modelscope.cn 下载的模型是 json 文件,不是txt的

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

方便改用System.Text.Json吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants