leancodepl / arb_translate

A command-line tool for automatically adding missing message translations to ARB files using Google Gemini LLM by LeanCode
https://leancode.co
Apache License 2.0
47 stars 5 forks source link

Quota reached on vertex Ai #7

Closed FantaMagier closed 5 months ago

FantaMagier commented 6 months ago

Hey, cool package but could you maybe reduce the request size for Vertex: I reach the maximum continent almost immediately after starting. I've already tried to increase it in the Google Cloud Dashboard but for new accounts the maximum continent allowed is 0-5 and 5 is already set. I have contacted the Google sales system. Maybe they can increase it quickly and only charge me for server distribution, let's see. Maybe you can find a quick solution. Thanks for the work!

Translating 1360 terms for locale en...
Translated batch 1/18
Translated batch 3/18
Failed to parse response for 2/18, retrying 1/5...
Translated batch 5/18
Translated batch 4/18
Failed to parse response for 2/18, retrying 2/5...
Failed to parse response for 2/18, retrying 3/5...
Unhandled exception:
Quota exceeded for aiplatform.googleapis.com/generate_content_requests_per_minute_per_project_per_base_model with base model: gemini-pro. Please submit a quota increase request. https://cloud.google.com/vertex-ai/docs/generative-ai/quotas-genai.
#0      GenerativeModel.generateContent (package:google_generative_ai/src/model.dart:130:9)
<asynchronous suspension>
#1      GeminiTranslationDelegate._translateBatch (package:arb_translate/src/translation_delegates/gemini_translation_delegate.dart:130:21)
<asynchronous suspension>
#2      Future.wait.<anonymous closure> (dart:async/future.dart:518:21)
<asynchronous suspension>
#3      GeminiTranslationDelegate.translate (package:arb_translate/src/translation_delegates/gemini_translation_delegate.dart:65:28)
RobertOdrowaz commented 6 months ago

Hi, thanks for reporting it's possible the quota error isn't handled correctly for Vertex AI. I will look into it

RobertOdrowaz commented 5 months ago

The new version (0.1.3) should catch and handle Vertex AI quota exception. You can also try using us-central1 region if you haven't before. It has much higher quota than other regions (300 vs 10 for my account)