更新时间:2024-08-21 GMT+08:00
通过API接口查询AI应用详情,model_name返回值出现乱码
问题现象
通过API接口查询AI应用详情,model_name返回值出现乱码。例如model_name为query_vec_recall_model,但是api接口返回结果是query_vec_recall_model_b。
[2022/08/12 00:03:25 GMT+0800][INFO]Execute user name is xxx. user id is 04ef6da71400125321f15c01f1d1xxxx, job id is 6ABxxx [2022/08/12 00:03:25 GMT+0800][INFO]Request url is https://modelarts.xxx.xxx.com/v1/88exxxta/models?model_name=query_vec_recall_model [2022/08/12 00:03:25 GMT+0800][INFO]Request query param is nul [2022/08/12 00:03:25 GMT+0800][INFO]Request method is GET [2022/08/12 00:03:25 GMT+0800][INFO]Request header is {REST_API_MARK=REST API MARK, User-Agent=Dayu} [2022/08/12 00:03:26 GMT+0800][INFO]Response body: {"count":3"total_count":0"models":[{"model id":"ca12cbdb-e7eb-4084-9ea3-36c0bd6axxxx","model name":"query_vec_recall_model_b","model_version":"0.0.1","model_type":"TensorFlow"......
原因分析
当模型名称包含下划线时,下划线涉及转义处理。
处理方法
需要在请求中增加exact_match参数,且参数值设置为true,确保model_name返回值正确。
父主题: AI应用管理