Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

HuggingFace Chat Target - optional

This notebook is designed to demonstrate instruction models that use a chat template, allowing users to experiment with structured chat-based interactions. Non-instruct models are excluded to ensure consistency and reliability in the chat-based interactions. More instruct models can be explored on Hugging Face.

Key Points:

  1. Supported Instruction Models:

    • This notebook supports the following instruct models that follow a structured chat template. These are examples, and more instruct models are available on Hugging Face:

      • HuggingFaceTB/SmolLM-360M-Instruct

      • microsoft/Phi-3-mini-4k-instruct

      • ...

  2. Excluded Models:

    • Non-instruct models (e.g., "google/gemma-2b", "princeton-nlp/Sheared-LLaMA-1.3B-ShareGPT") are not included in this demo, as they do not follow the structured chat template required for the current local Hugging Face model support.

  3. Model Response Times:

    • The tests were conducted using a CPU, and the following are the average response times for each model:

      • HuggingFaceTB/SmolLM-1.7B-Instruct: 5.87 seconds

      • HuggingFaceTB/SmolLM-135M-Instruct: 3.09 seconds

      • HuggingFaceTB/SmolLM-360M-Instruct: 3.31 seconds

      • microsoft/Phi-3-mini-4k-instruct: 4.89 seconds

      • Qwen/Qwen2-0.5B-Instruct: 1.38 seconds

      • Qwen/Qwen2-1.5B-Instruct: 2.96 seconds

      • stabilityai/stablelm-2-zephyr-1_6b: 5.31 seconds

      • stabilityai/stablelm-zephyr-3b: 8.37 seconds

Found default environment files: ['./.pyrit/.env', './.pyrit/.env.local']
Loaded environment file: ./.pyrit/.env
Loaded environment file: ./.pyrit/.env.local
Running model: Qwen/Qwen2-0.5B-Instruct
Average response time for Qwen/Qwen2-0.5B-Instruct: 18.39 seconds


────────────────────────────────────────────────────────────────────────────────────────────────────
🔹 Turn 1 - USER
────────────────────────────────────────────────────────────────────────────────────────────────────
  What is 3*3? Give me the solution.

────────────────────────────────────────────────────────────────────────────────────────────────────
🔸 ASSISTANT
────────────────────────────────────────────────────────────────────────────────────────────────────
  12

────────────────────────────────────────────────────────────────────────────────────────────────────

────────────────────────────────────────────────────────────────────────────────────────────────────
🔹 Turn 1 - USER
────────────────────────────────────────────────────────────────────────────────────────────────────
  What is 4*4? Give me the solution.

────────────────────────────────────────────────────────────────────────────────────────────────────
🔸 ASSISTANT
────────────────────────────────────────────────────────────────────────────────────────────────────
  The value of 4*4 is 16.

────────────────────────────────────────────────────────────────────────────────────────────────────
Qwen/Qwen2-0.5B-Instruct: 18.39 seconds