gguf chat text-generation en license:other endpoints_compatible region:us conversational
---
language:
- en
license: other
license_name: tongyi-qianwen
license_link: https://huggingface.co/Qwen/Qwen1.5-32B-Chat/blob/main/LICENSE
pipeline_tag: text-generation
tags:
- chat
quantized_by: bartowski
lm_studio:
  param_count: 32b
  use_case: chat
  release_date: 03-04-2024
  model_creator: Qwen
  prompt_template: ChatML
  system_prompt: You are a helpful assistant
  base_model: Qwen2
  original_repo: Qwen/Qwen1.5-32B-Chat
---

## 💫 Community Model> Qwen 1.5 32B Chat By Qwen

*👾 [LM Studio](https://lmstudio.ai) Community models highlights program. Highlighting new & noteworthy models by the community. Join the conversation on [Discord](https://discord.gg/aPQfnNkxGC)*.

**Model creator:** [Qwen](https://huggingface.co/Qwen)<br>
**Original model**: [Qwen1.5-32B-Chat](https://huggingface.co/Qwen/Qwen1.5-32B-Chat)<br>
**GGUF quantization:** provided by [bartowski](https://huggingface.co/bartowski) based on `llama.cpp` release [b2589](https://github.com/ggerganov/llama.cpp/releases/tag/b2589)<br>

## Model Summary:
After a hugely successful 72B model, Qwen has released this brand new 32B model. This model has amazing chat capabilties, multilingual for both conversation and coding, and decent context lengths.<br>
Check out more details from their blog post [here](http://qwenlm.github.io/blog/qwen1.5-32b/).

## Prompt template:

Choose the `ChatML` preset in your LM Studio.

Under the hood, the model will see a prompt that's formatted like so:

```
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
```

## Use case and examples

Qwen2 is great at making conversations in multiple languages, and also has decent coding capabilities.

### Creativity

```
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Give me a short introduction to large language model.<|im_end|>
<|im_start|>assistant
Large language models are artificial intelligence systems designed to process and generate
human-like language at scale. These models are typically built using deep learning
techniques, specifically neural networks, and are trained on massive amounts of text
data from the internet, books, and other sources. They are capable of understanding context,
generating coherent responses, and even performing complex language-based tasks such as
translation, summarization, and question-answering. Large language models like GPT-3, T5, and
BERT have revolutionized the field of natural language processing (NLP) by achieving state-of-the-art
performance in various tasks and enabling more human-like interactions with machines.<|im_end|>
```

### Coding

```
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
Implement quicksort using C++<|im_end|>
<|im_start|>assistant
Sure, here's an implementation of the quicksort algorithm in C++:

    #include <iostream>
    using namespace std;
    
    // Function to swap two elements
    void swap(int* a, int* b) {
        int t = *a;
        *a = *b;
        *b = t;
    }
    
    // Function to partition the array
    int partition (int arr[], int low, int high) {
        int pivot = arr[high];    // pivot
        int i = (low - 1);  // Index of smaller element
    
        for (int j = low; j <= high- 1; j++) {
            // If current element is smaller than the pivot
            if (arr[j] < pivot) {
                i++;    // increment index of smaller element
                swap(&arr[i], &arr[j]);
            }
        }
        swap(&arr[i + 1], &arr[high]);
        return (i + 1);
    }
    
    // Function to perform quicksort
    void quickSort(int arr[], int low, int high) {
        if (low < high) {
            // pi is partitioning index, arr[p] is now
            // at right place
            int pi = partition(arr, low, high);
    
            // Separately sort elements before
            // partition and after partition
            quickSort(arr, low, pi - 1);
            quickSort(arr, pi + 1, high);
        }
    }
    
    // Function to print an array
    void printArray(int arr[], int size) {
        int i;
        for (i=0; i < size; i++)
            cout << arr[i] << " ";
        cout << endl;
    }
    
    // Driver program to test above functions
    int main() {
        int arr[] = {10, 7, 8, 9, 1, 5};
        int n = sizeof(arr)/sizeof(arr[0]);
        quickSort(arr, 0, n-1);
        cout << "Sorted array: \n";
        printArray(arr, n);
        return 0;
    }

In this implementation, the `quickSort` function recursively calls itself to
sort the elements before and after the pivot element, which is determined using
the `partition` function. The `swap` function is used to swap elements in the
array. The `printArray` function is used to print the sorted array.<|im_end|>
```

### Conversational

```
<|im_start|>system
You are a helpful assistant<|im_end|>
<|im_start|>user
What do the vacuum tubes in an amplifier do?<|im_end|>
<|im_start|>assistant
Vacuum tubes in an amplifier serve as electronic switches and amplifiers
that can control the flow of electrical current in a circuit. They play
a crucial role in amplifying the input signal, whether it's a weak audio
signal or something else, to produce a louder or stronger output signal.

Here's a detailed explanation of what vacuum tubes do in an amplifier:

1. **Electron Emission**: In a vacuum tube, an electrode called the
cathode is heated, usually by an electrical current. This heating
causes the cathode to emit electrons into the vacuum space inside
the tube. The process is called thermionic emission.

2. **Controlled Current Flow**: The emitted electrons are attracted
to another electrode called the anode, which is at a higher voltage
than the cathode. A third electrode, called the grid, is placed between
the cathode and the anode. By varying the voltage on the grid relative
to the cathode, the flow of electrons from the cathode to the anode
can be controlled. If the grid voltage is more negative than the
cathode, fewer electrons will reach the anode, and vice versa. This
control over electron flow is the basis for amplification.

3. **Amplification**: When an input signal (the weak signal to be
amplified) is applied to the grid, it modulates the flow of electrons
from the cathode to the anode. As the number of electrons passing
through the tube changes in response to the input signal, the current
flowing through the anode also changes. This change in current is then
amplified and can be used to drive a speaker or other output device.

4. **Linear Amplification**: Vacuum tubes are particularly good at
providing linear amplification, meaning that the output signal is
proportional to the input signal. This is important for maintaining
the integrity of the original signal, especially in audio amplifiers
where distortion should be minimized.

5. **Overdrive and Distortion**: If the input signal becomes too
strong, the vacuum tube can be driven into "overdrive," where the
control of the grid over the electron flow breaks down, and the
output signal becomes distorted. This effect is often used in guitar
amplifiers to create a "crunchy" or "fuzzy" sound.

In summary, vacuum tubes in an amplifier enable the controlled
manipulation of electrical current, allowing for the amplification
of signals with minimal distortion. They have been a key component
in electronic amplification for decades, although solid-state devices
like transistors have largely replaced them in modern electronics due
to their lower power consumption, smaller size, and higher reliability.<|im_end|>
```

## Technical Details

Qwen 1.5 32B chat is trained on a diverse dataset and then was tuned with Supervised Fine Tuning (SFT) and Direct Preference Optimization (DPO) for its excellent chat capabilities.

Trained on multiple languages, the model has shown excellent performance in the following languages in addition to its great English performance:

- Arabic
- Spanish
- French
- Portuguese
- German
- Italian
- Russian
- Japanese
- Korean
- Vietnamese
- Thai
- Indonesian

Supports 32k context for very long conversations.

## Special thanks

🙏 Special thanks to [Georgi Gerganov](https://github.com/ggerganov) and the whole team working on [llama.cpp](https://github.com/ggerganov/llama.cpp/) for making all of this possible.

## Disclaimers

LM Studio is not the creator, originator, or owner of any Model featured in the Community Model Program. Each Community Model is created and provided by third parties. LM Studio does not endorse, support, represent or guarantee the completeness, truthfulness, accuracy, or reliability of any Community Model.  You understand that Community Models can produce content that might be offensive, harmful, inaccurate or otherwise inappropriate, or deceptive. Each Community Model is the sole responsibility of the person or entity who originated such Model. LM Studio may not monitor or control the Community Models and cannot, and does not, take responsibility for any such Model. LM Studio disclaims all warranties or guarantees about the accuracy, reliability or benefits of the Community Models.  LM Studio further disclaims any warranty that the Community Model will meet your requirements, be secure, uninterrupted or available at any time or location, or error-free, viruses-free, or that any errors will be corrected, or otherwise. You will be solely responsible for any damage resulting from your use of or access to the Community Models, your downloading of any Community Model, or use of any other Community Model provided by or through LM Studio.
