Win10 WSL2 Ubuntu + OpenAI GPT-4 api

kyk
Reactions: 441
Сообщения: 6086
Зарегистрирован: Ср июн 15, 2022 6:54 pm

Re: Win10 WSL2 Ubuntu + OpenAI GPT-4 api

Сообщение kyk »

elpresidente* писал(а): Ср мар 06, 2024 2:28 pm Практически уверен что "maxOutputTokens": 30720
Получается, что при достаточном кол-ве токенов, Gemini API послушно выполняет задание и не "ленится".

В том время, как OpenAI GPT-4 в аналогичной ситуации поступает по своему усмотрению и таки "ленится", причём иногда может randomly выдать больше результатов, а иногда меньше.
elpresidente*
Site Admin
Reactions: 846
Сообщения: 2897
Зарегистрирован: Сб май 14, 2022 5:03 pm

Re: Win10 WSL2 Ubuntu + OpenAI GPT-4 api

Сообщение elpresidente* »

kyk писал(а): Ср мар 06, 2024 2:50 pm
elpresidente* писал(а): Ср мар 06, 2024 2:28 pm Практически уверен что "maxOutputTokens": 30720
Получается, что при достаточном кол-ве токенов, Gemini API послушно выполняет задание и не "ленится".

В том время, как OpenAI GPT-4 в аналогичной ситуации поступает по своему усмотрению, причём причём иногда может randomly выдать больше, а иногда меньше.
Похоже на то, причем мой пример использовал самую последнюю модель с фиксом:
https://openai.com/blog/new-embedding-m ... pi-updates
Today, we are releasing an updated GPT-4 Turbo preview model, gpt-4-0125-preview. This model completes tasks like code generation more thoroughly than the previous preview model and is intended to reduce cases of “laziness” where the model doesn’t complete a task.
kyk
Reactions: 441
Сообщения: 6086
Зарегистрирован: Ср июн 15, 2022 6:54 pm

Re: Win10 WSL2 Ubuntu + OpenAI GPT-4 api

Сообщение kyk »

OpenAI GPT-4 Chat Completions API response looks as follows:

Код: Выделить всё

{
  "choices": [
    {
      "finish_reason": "stop",
      "index": 0,
      "message": {
        "content": "The 2020 World Series was played in Texas at Globe Life Field in Arlington.",
        "role": "assistant"
      },
      "logprobs": null
    }
  ]
  }
}
The finish_reason field in the OpenAI API's response indicates why the model stopped generating text for a particular completion.

"stop": This means that the generation was stopped because the model encountered a stop sequence specified in the prompt or by the parameters in the API call. Stop sequences can be explicit (like a specific word or punctuation mark that signals the end of a text) or implicit based on the prompt structure.

"length": This value indicates that the generation reached the maximum length specified in the request. The API allows users to set a maximum number of tokens to be generated, and if the completion reaches this limit, the generation will stop with "length" as the finish_reason.

"token_limit": Similar to "length", this indicates that the generation has reached the total token limit set for the API call. It's a constraint on the maximum size of the output, ensuring that responses don't exceed the bounds set by the user or the limits of the API

Each of these finish reasons helps in understanding the boundaries of the generated text and can be useful in debugging or refining API requests. For example, if you consistently receive "length" as the finish_reason, you might consider increasing the maximum token limit for your requests if you need longer responses. .
Я посмотрел

Код: Выделить всё

 print(response.choices[0].finish_reason)
Печатает просто строку из одного слова:
kyk
Reactions: 441
Сообщения: 6086
Зарегистрирован: Ср июн 15, 2022 6:54 pm

Re: Win10 WSL2 Ubuntu + OpenAI GPT-4 api

Сообщение kyk »

kyk писал(а): Ср мар 06, 2024 1:14 pm Gemini Pro с вашей задачей справился без проблем viewtopic.php?p=603502#p603502
если сравнивать Gemini Pro с СhatGPT3.5 и ChatGPT-4 по интеллекту.

Вот так получается?
'СhatGPT3.5' < 'Gemini Pro'< 'ChatGPT-4'


Вы в Gemini Pro API эту фунцию пользуете?

Код: Выделить всё

response = model.generate_content()
Какой у неё token limit если измерять так же как в ChatGPT?
elpresidente*
Site Admin
Reactions: 846
Сообщения: 2897
Зарегистрирован: Сб май 14, 2022 5:03 pm

Re: Win10 WSL2 Ubuntu + OpenAI GPT-4 api

Сообщение elpresidente* »

kyk писал(а): Чт мар 07, 2024 2:11 am Вот так получается?
'СhatGPT3.5' < 'Gemini Pro'< 'ChatGPT-4'
Можно посмотреть результаты тестов и примерно прикинуть. Но как мы видим на практике результат может быть совсем другим.
kyk писал(а): Чт мар 07, 2024 2:11 am Вы в Gemini Pro API эту фунцию пользуете?
Плагин на этом сайте использует REST API https://ai.google.dev/tutorials/rest_quickstart
kyk
Reactions: 441
Сообщения: 6086
Зарегистрирован: Ср июн 15, 2022 6:54 pm

Re: Win10 WSL2 Ubuntu + OpenAI GPT-4 api

Сообщение kyk »

elpresidente* писал(а): Чт мар 07, 2024 8:10 am Плагин на этом сайте использует REST API https://ai.google.dev/tutorials/rest_quickstart
я только Python могу, поэтому мне наверно сюда
https://ai.google.dev/tutorials/python_quickstart
Ответить