Skip to content

Generation Error with Ollama - Inconsistent Output Generation #1393

Open
@juanjuanignacio

Description

@juanjuanignacio

Hi,

I'm experiencing issues while running GEMMA2 on Ollama. Specifically, I'm encountering the following problems:

Error on Message Generation:
Whenever a new chat is created, every message results in the error:

Error: Generation failed, in the back end

No output is generated,on the front end.

Inconsistent Message Handling:
After retrying the same message multiple times (ranging from 2 to 15 attempts), the message is eventually processed correctly and the output is displayed on the front end.

Server Responsiveness:
Despite the above issues, the server responds to every query.

Expected Behavior:
Messages should be processed and output generated on the first attempt without errors.

Additional Context:

Ollama Version: 0.3.3
GEMMA2:2b (I've tried others models and the problem is the same)
Operating System: CentOS

Relevant Logs:
error message:

    ERROR (537688): Generation failed
        err: {
          "type": "Error",
          "message": "Generation failed",
          "stack":
              Error: Generation failed
                  at Module.generateFromDefaultEndpoint (/chat-ui/src/lib/server/generateFromDefaultEndpoint.ts:23:9)
                  at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                  at async generateTitle (/chat-ui/src/lib/server/textGeneration/title.ts:54:10)
                  at async Module.generateTitleForConversation (/chat-ui/src/lib/server/textGeneration/title.ts:17:19)

Its something with the title of the conversation but retrying the message finally the conversations name is changed too. And messages after conversations name is changed have the same problem, rarely it works at first attempt.

My env.local:

  MONGODB_URL="mongodb://localhost:27017"
  HF_TOKEN=Mytoken
  OPENAI_API_KEY="ollama"
  MODELS=`[
    {
        "name": "google/gemma-2-2b-it",
        "chatPromptTemplate": "{{#each messages}}{{#ifUser}}<start_of_turn>user\n{{#if @first}}{{#if @root.preprompt}}{{@root.preprompt}}\n{{/if}}{{/if}}{{content}}<end_of_turn>\n<start_of_turn>model\n{{/ifUser}}{{#ifAssistant}}{{content}}<end_of_turn>\n{{/ifAssistant}}{{/each}}",
        "parameters": {
          "temperature": 0.1,
          "top_p": 0.95,
          "repetition_penalty": 1.2,
          "max_new_tokens": 2048,
          "stop": ["<end_of_turn>"]
        },
        "endpoints": [
          {
           "type": "ollama",
           "baseURL": "http://127.0.0.1:11434",
            "ollamaName" : "gemma2:2b"
          }
        ]
    },
  ]`
  
  USE_LOCAL_WEBSEARCH=true

Any assistance in resolving this issue would be greatly appreciated. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    supportA request for help setting things up

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions