lm-sys / FastChat

An open platform for training, serving, and evaluating large language models. Release repo for Vicuna and Chatbot Arena.
Apache License 2.0
36.96k stars 4.56k forks source link

OpenChat 3.5 Default Conversation Template #2667

Open bsu3338 opened 1 year ago

bsu3338 commented 1 year ago

openchat_3.5 seems to be using the default conversation template vs the openchat_3.5 specific template.

Log: fastchat-model-worker-1 |INFO 11-09 19:37:00 async_llm_engine.py:371] Received request a0943f1021f24c3e94e312724ec364dd: prompt: "A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.\n### Human: Got any creative ideas for a 10 year old’s birthday?\n### Assistant: Of course! Here are some creative ideas for a 10-year-old's birthday party:\n1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.\n2. Science Party: Plan a science-themed party where kids can engage in fun and interactive experiments. You can set up different stations with activities like making slime, erupting volcanoes, or creating simple chemical reactions.\n3. Outdoor Movie Night: Set up a backyard movie night with a projector and a large screen or white sheet. Create a cozy seating area with blankets and pillows, and serve popcorn and snacks while the kids enjoy a favorite movie under the stars.\n4. DIY Crafts Party: Arrange a craft party where kids can unleash their creativity. Provide a variety of craft supplies like beads, paints, and fabrics, and let them create their own unique masterpieces to take home as party favors.\n5. Sports Olympics: Host a mini Olympics event with various sports and games. Set up different stations for activities like sack races, relay races, basketball shooting, and obstacle courses. Give out medals or certificates to the participants.\n6. Cooking Party: Have a cooking-themed party where the kids can prepare their own mini pizzas, cupcakes, or cookies. Provide toppings, frosting, and decorating supplies, and let them get hands-on in the kitchen.\n7. Superhero Training Camp: Create a superhero-themed party where the kids can engage in fun training activities. Set up an obstacle course, have them design their own superhero capes or masks, and organize superhero-themed games and challenges.\n8. Outdoor Adventure: Plan an outdoor adventure party at a local park or nature reserve. Arrange activities like hiking, nature scavenger hunts, or a picnic with games. Encourage exploration and appreciation for the outdoors.\nRemember to tailor the activities to the birthday child's interests and preferences. Have a great celebration!\n### Human: What is the capital of Texas\n### Assistant:", sampling params: SamplingParams(n=1, best_of=1, presence_penalty=0.0, frequency_penalty=0.0, temperature=1.0, top_p=1.0, top_k=-1, use_beam_search=False, length_penalty=1.0, early_stopping=False, stop=['||>', '###', '<|diff_marker|>', '<|end_of_turn|>', '\nUser:'], ignore_eos=False, max_tokens=7650, logprobs=None, prompt_logprobs=None, skip_special_tokens=True), prompt token ids: None.

infwinston commented 1 year ago

what command did you use?

bsu3338 commented 1 year ago

This was the command I used in the docker-compose file to launch the model

entrypoint: ["python3.9", "-m", "fastchat.serve.vllm_worker", "--model-names", "openchat_3.5", "--model-path", "openchat/openchat_3.5", "--worker-address", "http://fastchat-model-worker:21002", "--controller-address", "http://fastchat-controller:21001", "--host", "0.0.0.0", "--port", "21002"]

I use LibreChat to communicate with the model through the OpenAI compatible API From LibreChat:

ask log
{
  text: 'What is the capital of Texas',
  conversationId: null,
  endpointOption: {
    endpoint: 'openAI',
    chatGptLabel: null,
    promptPrefix: null,
    modelOptions: {
      model: 'openchat_3.5',
      temperature: 1,
      top_p: 1,
      presence_penalty: 0,
      frequency_penalty: 0
    }
  }
}
{ '0d067bed-0dbc-4351-9ae7-14d572c16e1a': 10, instructions: undefined }
userMessage.tokenCount 10
userMessage {
  messageId: '0d067bed-0dbc-4351-9ae7-14d572c16e1a',
  parentMessageId: '00000000-0000-0000-0000-000000000000',
  conversationId: '8552052e-838e-4e36-8f4e-a9787860728c',
  sender: 'User',
  text: 'What is the capital of Texas',
  isCreatedByUser: true,
  tokenCount: 10
}
[Meilisearch] Convo not found and will index 8552052e-838e-4e36-8f4e-a9787860728c
[llm/start] [1:llm:ChatOpenAI] Entering LLM run with input: {
  "messages": [
    [
      {
        "lc": 1,
        "type": "constructor",
        "id": [
          "langchain",
          "schema",
          "SystemMessage"
        ],
        "kwargs": {
          "content": "Detect the language used in the following text.",
          "additional_kwargs": {}
        }
      },
      {
        "lc": 1,
        "type": "constructor",
        "id": [
          "langchain",
          "schema",
          "HumanMessage"
        ],
        "kwargs": {
          "content": "What is the capital of Texas",
          "additional_kwargs": {}
        }
      }
    ]
  ]
}
[llm/end] [1:llm:ChatOpenAI] [387ms] Exiting LLM run with output: {
  "generations": [
    [
      {
        "text": " The capital of Texas is Austin.\n",
        "message": {
          "lc": 1,
          "type": "constructor",
          "id": [
            "langchain",
            "schema",
            "AIMessage"
          ],
          "kwargs": {
            "content": " The capital of Texas is Austin.\n",
            "additional_kwargs": {}
          }
        },
        "generationInfo": {
          "finish_reason": "stop"
        }
      }
    ]
  ],
  "llmOutput": {
    "tokenUsage": {
      "completionTokens": 9,
      "promptTokens": 522,
      "totalTokens": 531
    }
  }
}
There was an issue generating title with LangChain, trying the old method...
infwinston commented 1 year ago

what commit of fastchat are you at? openchat is added after this commit https://github.com/lm-sys/FastChat/pull/2638

bsu3338 commented 1 year ago

I just cloned the current main branch and rebuilt the docker image. I am still getting the same results.

infwinston commented 1 year ago

can you test it with this command first and see if it uses the correct template? it works fine on our side and we've serving it for a few days.

python3 -m fastchat.serve.cli --model-path openchat/openchat_3.5 --debug