У меня есть очень простой скрипт, который вызывает генерацию модели в Vertex AI:
< pre class="lang-py Prettyprint-override">
Код: Выделить всё
import vertexai
from vertexai.preview.generative_models import GenerativeModel
import asyncio
PROJECT_ID = "MY_PROJECT"
vertexai.init(project=PROJECT_ID, location="us-central1")
async def _query_async(model: GenerativeModel, i: int) -> str:
print(f"Sending request {i}")
response = await model.generate_content_async("message")
return response.text
async def run_pipeline_async() -> str:
model = GenerativeModel("gemini-1.5-pro-002")
query_jobs = asyncio.gather(*[_query_async(model, i) for i in range(5)])
query_responses = await query_jobs
return query_responses
result = asyncio.run(run_pipeline_async())
print(result)
Код: Выделить всё
Sending request 0
Sending request 1
Sending request 2
Sending request 3
Sending request 4
Код: Выделить всё
Exception has occurred: ResourceExhausted
429 Online prediction request quota exceeded for gemini-1.5-pro. Please try again later with backoff.
grpc.aio._call.AioRpcError:
The above exception was the direct cause of the following exception:
File "D:\Users\Harry\Code\PropScan\document\rate_limit_test.py", line 18, in _query_async
response = await model.generate_content_async("message")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Users\Harry\Code\PropScan\document\rate_limit_test.py", line 26, in run_pipeline_async
query_responses = await query_jobs
^^^^^^^^^^^^^^^^
File "D:\Users\Harry\Code\PropScan\document\rate_limit_test.py", line 30, in
result = asyncio.run(run_pipeline_async())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
google.api_core.exceptions.ResourceExhausted: 429 Online prediction request quota exceeded for gemini-1.5-pro. Please try again later with backoff.

Я немного не понимаю, где идти отсюда... Квота и система Панель управления ограничениями мне вообще не помогает (думаю, я смотрю здесь правильно?)
[img]https:/ /i.sstatic.net/nSRiqejP.png[/img]
Буду признателен за любую помощь, спасибо!
Подробнее здесь: https://stackoverflow.com/questions/793 ... -vertex-ai
Мобильная версия