【发布时间】:2021-08-05 06:59:41
【问题描述】:
我的目标是使用 google 模型适配来提高语音到文本的准确性,但是这些 API 在任何地方都没有很好的文档记录。
我尝试创建一个具有 200000 个值的自定义类。在该计数之上,它会给出有效负载大小的错误,而不是条目计数限制。 我在哪里可以找到 API 的正确信息/详细信息及其限制。
我正在使用 Ruby 库来创建自定义类。
创建自定义类的代码。
cname = "TestClass"
items = 3_00_000.times.map{|e| Google::Cloud::Speech::V1p1beta1::CustomClass::ClassItem.new(value: Faker::Name.name) };
_class = Google::Cloud::Speech::V1p1beta1::CustomClass.new(name: cname, items: items);
request = Google::Cloud::Speech::V1p1beta1::CreateCustomClassRequest.new({custom_class: _class, parent: "projects/<projectID>/locations/global", custom_class_id: cname})
_klass = client.create_custom_class request
似乎正在使用 10_000_000 值创建/更新以下错误。
Google::Cloud::InvalidArgumentError: 3:Request payload size exceeds the limit: 10485760 bytes.. debug_error_string:{"created":"@1628230030.306827000","description":"Error received from peer ipv4:142.251.42.10:443","file":"src/core/lib/surface/call.cc","file_line":1067,"grpc_message":"Request payload size exceeds the limit: 10485760 bytes.","grpc_status":3}
【问题讨论】:
-
列出任何限制/配额信息here
-
@PjoterS 是的,我正在使用相同的 API 来使用自定义类令牌进行适配。我在问题中添加了错误。
-
@MBHAPhoenix 谢谢,但是该链接是针对语音到文本 api 的,而不是针对模型适配 api。
-
你能在没有私人信息的情况下分享你的代码/步骤吗?您的请求是从您的机器或 GCS 获取音频文件吗?
Request payload size exceeds the limit: 10485760 bytes建议您的文件为 10MB 以上。您的音频文件有多长,它有多少 MB?如果您使用音频的时间超过 1 分钟,建议您使用 Google Cloud Storage。
标签: ruby google-cloud-platform google-speech-to-text-api