How to Use Qwen 2 Models Together with Anakin AI

In this article, we'll explore how you can leverage the power of Qwen 2 models to create AI applications using Anakin AI, a no-code platform for building AI apps.

1000+ Pre-built AI Apps for Any Use Case

How to Use Qwen 2 Models Together with Anakin AI

Start for free
Contents

Qwen 2 is a series of large language models developed by Alibaba Cloud, ranging from 0.5B to 72B parameters. These models have shown impressive performance on various benchmarks, including natural language understanding, coding, and mathematics. In this article, we'll explore how you can leverage the power of Qwen 2 models to create AI applications using Anakin AI, a no-code platform for building AI apps.

Here is an expanded section on the introduction to Qwen 2 models with more technical details, examples, and a benchmark table:

Introduction to Qwen 2 Models

Qwen 2
Qwen 2

Qwen 2 is a series of large language models developed by Alibaba Cloud, ranging from 0.5B to 72B parameters. These models have been pre-trained on a massive corpus of data spanning multiple languages, including web texts, books, code repositories, and more. While the training data has a focus on English and Chinese, it also covers 27 additional languages, making Qwen 2 a truly multilingual model series.

The Qwen 2 model family consists of five main variants, each with a different number of parameters:

  • Qwen2-0.5B: A compact model with 0.5 billion parameters.
  • Qwen2-1.5B: A mid-sized model with 1.5 billion parameters.
  • Qwen2-7B: A large model with 7 billion parameters.
  • Qwen2-57B-A14B: A massive model with 57 billion parameters, utilizing a Mixture of Experts (MoE) architecture.
  • Qwen2-72B: The flagship model with 72 billion parameters, currently one of the largest publicly available language models.

One of the key features of Qwen 2 is its ability to handle long context lengths. The Qwen2-7B-Instruct and Qwen2-72B-Instruct models, in particular, can process input sequences up to 128,000 tokens, enabling them to understand and generate responses based on extensive context.

Improved Coding and Mathematics Capabilities

A significant focus during the development of Qwen 2 was enhancing its performance in coding and mathematics tasks. By leveraging extensive code repositories and mathematical datasets during training, the models have demonstrated significant improvements in these areas compared to their predecessors.

For example, the Qwen2-72B-Instruct model achieves an impressive 86.0% accuracy on the HumanEval coding benchmark, outperforming the previous state-of-the-art models. Similarly, on the GSM8K mathematics benchmark, Qwen2-72B-Instruct scores 91.1%, showcasing its strong mathematical reasoning capabilities.

Multilingual Support and Performance

Qwen 2 models have been trained on data from 29 languages, including English, Chinese, and 27 additional languages. This multilingual training approach enables the models to understand and generate text in multiple languages, making them suitable for a wide range of applications across different regions and cultures.

To evaluate the multilingual performance of Qwen 2, the team conducted extensive benchmarking using various datasets. The following table summarizes the performance of the Qwen2-72B-Instruct model on several key benchmarks:

Benchmark Task Score
MMLU Natural Language Understanding (English) 82.3%
GPQA Question Answering (English) 42.4%
C-Eval Natural Language Understanding (Chinese) 83.8%
AlignBench Text-to-Text Translation (Chinese-English) 8.27 BLEU

As evident from the table, Qwen2-72B-Instruct demonstrates strong performance across various tasks in both English and Chinese, showcasing its multilingual capabilities.

Real-world Applications and Examples of Qwen 2

Qwen 2 models have already found applications in various domains, including:

Chatbots and Virtual Assistants: The models can be fine-tuned for conversational tasks, enabling the development of intelligent chatbots and virtual assistants capable of understanding and responding to user queries in multiple languages.

Code Generation and Assistance: With their improved coding capabilities, Qwen 2 models can be used to generate code snippets, provide code suggestions, and assist developers in various programming tasks.

Mathematical Problem-Solving: The strong mathematical reasoning abilities of Qwen 2 models make them suitable for solving complex mathematical problems, potentially aiding in fields such as scientific research and education.

Content Creation and Summarization: The models can be leveraged for tasks like article writing, content summarization, and creative writing, enabling the generation of high-quality content in multiple languages.

Machine Translation: The multilingual nature of Qwen 2 models allows for their use in machine translation tasks, facilitating communication across different languages.

With their impressive performance, multilingual support, and versatility, the Qwen 2 models are poised to drive advancements in various natural language processing applications, pushing the boundaries of what is possible with large language models.

Creating AI Apps with Qwen 2 Models on Anakin AI

Anakin AI is a no-code platform that allows you to create AI applications without writing a single line of code. You can leverage the power of Qwen 2 models to build various AI apps, such as chatbots, text generators, image generators, and more.

Step 1: Sign Up for Anakin AI

First, visit the Anakin AI website (https://www.anakin.ai/) and sign up for an account. Once you've signed up, you'll have access to the Anakin AI dashboard.

Step 2: Create a New App

In the Anakin AI dashboard, click on the "Create App" button to start building your AI app. You'll be prompted to choose the app type. For this example, let's select "Quick App" to create a text generation app.

Step 3: Configure the App

After selecting the app type, you'll be taken to the app configuration page. Here, you can define the input fields for your app. For a text generation app, you might want to include fields like "Topic," "Tone," or "Length."

Once you've defined the input fields, you can select the Qwen 2 model you want to use for your app. Anakin AI provides access to various Qwen 2 models, including Qwen2-0.5B, Qwen2-1.5B, Qwen2-7B, Qwen2-57B-A14B, and Qwen2-72B.

Step 4: Customize the App

Anakin AI allows you to customize the appearance and behavior of your app. You can choose the app icon, color scheme, and even add your own branding. Additionally, you can fine-tune the app's output by adjusting parameters like temperature, top-k, and top-p.

Step 5: Test and Deploy

Before deploying your app, you can test it to ensure it's working as expected. Anakin AI provides a built-in testing environment where you can input sample data and see the app's output.

Once you're satisfied with the app's performance, you can deploy it to the Anakin AI platform. Your app will be accessible to other users, and you can share it with your friends or colleagues.

Running Qwen 2 Models with Ollama

In addition to Anakin AI, you can also run Qwen 2 models locally using Ollama, a lightweight and efficient framework for running large language models on consumer hardware. Here's a step-by-step guide on how to run Qwen 2 models with Ollama:

Install Ollama by following the instructions on the official GitHub repository: https://github.com/ollama/ollama

Download the Qwen 2 model weights from the Hugging Face repository. For example, to download the Qwen2-7B-Instruct model, run the following command:

ollama download Qwen/Qwen2-7B-Instruct
  1. Once the model weights are downloaded, you can run the model using the ollama run command. For example:
ollama run Qwen/Qwen2-7B-Instruct --prompt "Write a short introduction to large language models."

This command will run the Qwen2-7B-Instruct model and generate a response based on the provided prompt.

  1. You can customize the model's behavior by adjusting various parameters, such as the temperature, top-k, and top-p values. For example, to set the temperature to 0.7 and the top-k value to 50, you can run:
ollama run Qwen/Qwen2-7B-Instruct --prompt "Write a short introduction to large language models." --temperature 0.7 --top-k 50
  1. Ollama also supports interactive mode, where you can have a conversation with the model. To enter interactive mode, run:
ollama run Qwen/Qwen2-7B-Instruct --interactive

This will open a prompt where you can type your messages, and the model will generate responses in real-time.

Anakin AI API Integration

In addition to the no-code app builder, Anakin AI also offers API integration, allowing developers and organizations to seamlessly integrate Anakin AI's AI capabilities into their existing applications. By leveraging the Anakin AI APIs, you can access various features, including text generation, image generation, and more, using the Qwen 2 models.

To use the Anakin AI APIs, you'll need to upgrade your plan and generate an API access token. Once you have the token, you can make API calls to Anakin AI's servers and receive the desired output.

Conclusion

Qwen 2 models are powerful language models that can be used for a wide range of applications, from text generation to code generation and mathematical problem-solving. By leveraging Anakin AI's no-code platform and API integration, you can easily create AI apps using Qwen 2 models without writing a single line of code. Whether you're a developer, a business owner, or an individual looking to explore the world of AI, Anakin AI and Qwen 2 models provide an accessible and powerful solution for your AI needs.