huggingface / chat-ui

Open source codebase powering the HuggingChat app
https://huggingface.co/chat
Apache License 2.0
7.21k stars 1.05k forks source link

Chat ui sends message prompt 404 #1458

Open nextdoorUncleLiu opened 1 week ago

nextdoorUncleLiu commented 1 week ago
MONGODB_URL='mongodb://localhost:27017'
PLAYWRIGHT_ADBLOCKER='false'
MODELS=`[
  {
    "name": "Local minicpm",
    "tokenizer": "minicpm",
    "preprompt": "",
    "chatPromptTemplate": "<s>{{preprompt}}{{#each messages}}{{#ifUser}}<|user|>\n{{content}}<|end|>\n<|assistant|>\n{{/ifUser}}{{#ifAssistant}}{{content}}<|end|>\n{{/ifAssistant}}{{/each}}",
    "parameters": {
      "stop": ["<|end|>", "<|endoftext|>", "<|assistant|>"],
      "temperature": 0.7,
      "max_new_tokens": 1024,
      "truncate": 3071
    },
    "endpoints": [{
      "type" : "openai",
      "baseURL": "***/v1/chat/completions",
      "defaultHeaders": {
        "x-portkey-config": '{ "Authorization": "Bearer apikey" }'
      }
    }],
  },
]`

Prompt for the following error:

ERROR (15839): 404 status code (no body)
    err: {
      "type": "NotFoundError",
      "message": "404 status code (no body)",
      "stack":
          Error: 404 status code (no body)
              at APIError.generate (file:///Users/user/Desktop/chat-ui/node_modules/openai/error.mjs:50:20)
              at OpenAI.makeStatusError (file:///Users/user/Desktop/chat-ui/node_modules/openai/core.mjs:268:25)
              at OpenAI.makeRequest (file:///Users/user/Desktop/chat-ui/node_modules/openai/core.mjs:311:30)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async eval (/Users/user/Desktop/chat-ui/src/lib/server/endpoints/openai/endpointOai.ts:111:36)
              at async Module.generateFromDefaultEndpoint (/Users/user/Desktop/chat-ui/src/lib/server/generateFromDefaultEndpoint.ts:11:23)
              at async generateTitle (/Users/user/Desktop/chat-ui/src/lib/server/textGeneration/title.ts:53:10)
              at async Module.generateTitleForConversation (/Users/user/Desktop/chat-ui/src/lib/server/textGeneration/title.ts:16:19)
      "status": 404,
      "headers": {
        "connection": "keep-alive",
        "content-encoding": "gzip",
        "content-type": "text/plain; charset=utf-8",
        "date": "Mon, 09 Sep 2024 13:29:16 GMT",
        "transfer-encoding": "chunked",
        "vary": "Accept-Encoding"
      }
    }
[21:29:16.156] ERROR (15839): 404 status code (no body)
    err: {
      "type": "NotFoundError",
      "message": "404 status code (no body)",
      "stack":
          Error: 404 status code (no body)
              at APIError.generate (file:///Users/user/Desktop/chat-ui/node_modules/openai/error.mjs:50:20)
              at OpenAI.makeStatusError (file:///Users/user/Desktop/chat-ui/node_modules/openai/core.mjs:268:25)
              at OpenAI.makeRequest (file:///Users/user/Desktop/chat-ui/node_modules/openai/core.mjs:311:30)
              at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
              at async eval (/Users/user/Desktop/chat-ui/src/lib/server/endpoints/openai/endpointOai.ts:111:36)
              at async Module.generate (/Users/user/Desktop/chat-ui/src/lib/server/textGeneration/generate.ts:8:30)
              at async textGenerationWithoutTitle (/Users/user/Desktop/chat-ui/src/lib/server/textGeneration/index.ts:62:3)
      "status": 404,
      "headers": {
        "connection": "keep-alive",
        "content-encoding": "gzip",
        "content-type": "text/plain; charset=utf-8",
        "date": "Mon, 09 Sep 2024 13:29:16 GMT",
        "transfer-encoding": "chunked",
        "vary": "Accept-Encoding"
      }
    }

Accessing through Postman alone is normal

pocman commented 5 days ago

could be related to empty content support on openai api https://github.com/huggingface/chat-ui/issues/1445#issuecomment-2346143719

nextdoorUncleLiu commented 4 days ago

Can chat ui support custom models, such as accessing my own server to receive and send messages