zsxkib / qwen2-7b-instruct

Qwen 2: A 7 billion parameter language model from Alibaba Cloud, fine tuned for chat completions

replicate.com
Total runs: 1.7K
24-hour runs: 0
7-day runs: 0
30-day runs: 0
Github
Model's Last Updated: June 26 2024

Introduction of qwen2-7b-instruct

Model Details of qwen2-7b-instruct

Readme

Qwen2-7B-Instruct on Replicate

This Replicate model provides access to the Qwen2-7B-Instruct model, part of the Qwen2 language model series. It offers three variants:

  • Qwen/Qwen2-7B-Instruct : Full precision model
  • Qwen/Qwen2-7B-Instruct-GPTQ-Int8 : 8-bit quantized model
  • Qwen/Qwen2-7B-Instruct-GPTQ-Int4 : 4-bit quantized model
Introduction

Qwen2 is the latest series of Qwen large language models, offering both pretrained and instruction-tuned models in five sizes: 0.5B, 1.5B, 7B, 57B-A14B, and 72B. This Replicate implementation focuses on the instruction-tuned 7B Qwen2 model.

Qwen2 demonstrates competitive performance against state-of-the-art open-source and proprietary models across various benchmarks, including language understanding, generation, multilingual capability, coding, mathematics, and reasoning.

Qwen2-7B-Instruct supports a context length of up to 131,072 tokens, enabling the processing of extensive inputs. Please refer to this section for detailed instructions on how to deploy Qwen2 for handling long texts.

For more details about Qwen2, visit:

Model Details

Qwen2 is based on the Transformer architecture and incorporates: - SwiGLU activation - Attention QKV bias - Group query attention - Improved tokenizer for multiple natural languages and code

Training Details

The model underwent pretraining with a large dataset, followed by post-training using both supervised fine-tuning and direct preference optimization.

Quickstart

To use this Replicate implementation:

  1. Visit the Replicate model page .

  2. Use the web interface or API to run a prediction with your desired parameters.

For local testing or development:

  1. Clone the repository: sh git clone -b Qwen2-7B-Instruct https://github.com/zsxkib/cog-qwen-2.git cd cog-qwen-2

  2. Run a prediction using Cog: sh cog predict \ -i 'top_k=1' \ -i 'top_p=1' \ -i 'prompt="Tell me a funny joke about cowboys in the style of Yoda from Star Wars"' \ -i 'model_type="Qwen2-7B-Instruct"' \ -i 'temperature=1' \ -i 'system_prompt="You are a funny and helpful assistant."' \ -i 'max_new_tokens=512' \ -i 'repetition_penalty=1'

Processing Long Texts

To handle extensive inputs exceeding 32,768 tokens, we utilize YARN , a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts.

For deployment, we recommend using vLLM. You can enable the long-context capabilities by following these steps:

  1. Install vLLM : You can install vLLM by running the following command.
pip install "vllm>=0.4.3"

Or you can install vLLM from source .

  1. Configure Model Settings : After downloading the model weights, modify the config.json file by including the below snippet: ```json { “architectures”: [ “Qwen2ForCausalLM” ], // … “vocab_size”: 152064,

        // adding the following snippets
        "rope_scaling": {
            "factor": 4.0,
            "original_max_position_embeddings": 32768,
            "type": "yarn"
        }
    }
    

    ``` This snippet enable YARN to support longer contexts.

  2. Model Deployment : Utilize vLLM to deploy your model. For instance, you can set up an openAI-like server using the command:

    bash python -m vllm.entrypoints.openai.api_server --served-model-name Qwen2-7B-Instruct --model path/to/weights

    Then you can access the Chat API by:

    bash curl http://localhost:8000/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "model": "Qwen2-7B-Instruct", "messages": [ {"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Your Long Input Here."} ] }'

    For further usage instructions of vLLM, please refer to our Github .

Note : Presently, vLLM only supports static YARN, which means the scaling factor remains constant regardless of input length, potentially impacting performance on shorter texts . We advise adding the rope_scaling configuration only when processing long contexts is required.

Evaluation

Performance comparison between Qwen2-7B-Instruct and similar-sized instruction-tuned LLMs:

Dataset Llama-3-8B-Instruct Yi-1.5-9B-Chat GLM-4-9B-Chat Qwen1.5-7B-Chat Qwen2-7B-Instruct
English
MMLU 68.4 69.5 72.4 59.5 70.5
MMLU-Pro 41.0 - - 29.1 44.1
GPQA 34.2 - - 27.8 25.3
TheoremQA 23.0 - - 14.1 25.3
MT-Bench 8.05 8.20 8.35 7.60 8.41
Coding
HumanEval 62.2 66.5 71.8 46.3 79.9
MBPP 67.9 - - 48.9 67.2
MultiPL-E 48.5 - - 27.2 59.1
Evalplus 60.9 - - 44.8 70.3
LiveCodeBench 17.3 - - 6.0 26.6
Mathematics
GSM8K 79.6 84.8 79.6 60.3 82.3
MATH 30.0 47.7 50.6 23.2 49.6
Chinese
C-Eval 45.9 - 75.6 67.3 77.2
AlignBench 6.20 6.90 7.01 6.20 7.21
Citation

If you find the Qwen2 model helpful in your work, please cite:

@article{qwen2,
  title={Qwen2 Technical Report},
  year={2024}
}
License

The Qwen2 model is licensed under the Apache 2.0 License.

Credits and Support

Pricing of qwen2-7b-instruct replicate.com

Run time and cost

This model costs approximately $0.0015 to run on Replicate, or 666 runs per $1, but this varies depending on your inputs. It is also open source and you can run it on your own computer with Docker .

This model runs on Nvidia A40 (Large) GPU hardware . Predictions typically complete within 3 seconds.

Runs of zsxkib qwen2-7b-instruct on replicate.com

1.7K
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs

More Information About qwen2-7b-instruct replicate.com Model

More qwen2-7b-instruct license Visit here:

https://huggingface.co/Qwen/Qwen2-7B-Instruct

qwen2-7b-instruct replicate.com

qwen2-7b-instruct replicate.com is an AI model on replicate.com that provides qwen2-7b-instruct's model effect (Qwen 2: A 7 billion parameter language model from Alibaba Cloud, fine tuned for chat completions), which can be used instantly with this zsxkib qwen2-7b-instruct model. replicate.com supports a free trial of the qwen2-7b-instruct model, and also provides paid use of the qwen2-7b-instruct. Support call qwen2-7b-instruct model through api, including Node.js, Python, http.

qwen2-7b-instruct replicate.com Url

https://replicate.com/zsxkib/qwen2-7b-instruct

zsxkib qwen2-7b-instruct online free

qwen2-7b-instruct replicate.com is an online trial and call api platform, which integrates qwen2-7b-instruct's modeling effects, including api services, and provides a free online trial of qwen2-7b-instruct, you can try qwen2-7b-instruct online for free by clicking the link below.

zsxkib qwen2-7b-instruct online free url in replicate.com:

https://replicate.com/zsxkib/qwen2-7b-instruct

qwen2-7b-instruct install

qwen2-7b-instruct is an open source model from GitHub that offers a free installation service, and any user can find qwen2-7b-instruct on GitHub to install. At the same time, replicate.com provides the effect of qwen2-7b-instruct install, users can directly use qwen2-7b-instruct installed effect in replicate.com for debugging and trial. It also supports api for free installation.

qwen2-7b-instruct install url in replicate.com:

https://replicate.com/zsxkib/qwen2-7b-instruct

Url of qwen2-7b-instruct

Provider of qwen2-7b-instruct replicate.com

Other API from zsxkib

replicate

Blip 3 / XGen-MM, Answers questions about images ({blip3,xgen-mm}-phi3-mini-base-r-v1)

Total runs: 1.2M
Run Growth: 0
Growth Rate: 0.00%
Updated:May 13 2024
replicate

📖 PuLID: Pure and Lightning ID Customization via Contrastive Alignment

Total runs: 1.2M
Run Growth: 0
Growth Rate: 0.00%
Updated:May 16 2024
replicate

Make realistic images of real people instantly

Total runs: 848.9K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2024
replicate

Create song covers with any RVC v2 trained AI voice from audio files.

Total runs: 637.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 16 2023
replicate

⚡️FLUX PuLID: FLUX-dev based Pure and Lightning ID Customization via Contrastive Alignment🎭

Total runs: 601.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:September 16 2024
replicate

🎨 Fill in masked parts of images with FLUX.1-dev 🖌️

Total runs: 349.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 20 2024
replicate

Add sound to video using the MMAudio V2 model. An advanced AI model that synthesizes high-quality audio from video content, enabling seamless video-to-audio transformation.

Total runs: 283.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:April 02 2025
replicate

✍️✨Prompts to auto-magically relights your images

Total runs: 207.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:May 21 2024
replicate

Age prediction using CLIP - Patched version of `https://replicate.com/andreasjansson/clip-age-predictor` that works with the new version of cog!

Total runs: 189.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:June 07 2023
replicate

✨DiffBIR: Towards Blind Image Restoration with Generative Diffusion Prior

Total runs: 132.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 12 2023
replicate

allenai/Molmo-7B-D-0924, Answers questions and caption about images

Total runs: 88.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:September 27 2024
replicate

Jina-CLIP v2: 0.9B multimodal embedding model with 89-language multilingual support, 512x512 image resolution, and Matryoshka representations

Total runs: 76.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 28 2024
replicate

🎨 AnimateDiff (w/ MotionLoRAs for Panning, Zooming, etc): Animate Your Personalized Text-to-Image Diffusion Models without Specific Tuning

Total runs: 56.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 06 2023
replicate

📽️ Increase Framerate 🎬 ST-MFNet: A Spatio-Temporal Multi-Flow Network for Frame Interpolation

Total runs: 51.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 09 2023
replicate

Hunyuan-Video LoRA Explorer + Trainer

Total runs: 31.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:January 25 2025
replicate

Monster Labs' Controlnet QR Code Monster v2 For SD-1.5 on top of AnimateDiff Prompt Travel (Motion Module SD 1.5 v2)

Total runs: 10.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 01 2023
replicate

🖼️✨Background images + prompts to auto-magically relights your images (+normal maps🗺️)

Total runs: 10.0K
Run Growth: 0
Growth Rate: 0.00%
Updated:May 21 2024
replicate

Real-Time Open-Vocabulary Object Detection

Total runs: 9.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:February 12 2024
replicate

AuraSR v2: Second-gen GAN-based Super-Resolution for real-world applications

Total runs: 9.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 01 2024
replicate

Create your own Realistic Voice Cloning (RVC v2) dataset using a YouTube link

Total runs: 8.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:November 21 2023
replicate

Text-to-Video + Image-to-Video: Pyramid Flow Autoregressive Video Generation method based on Flow Matching

Total runs: 8.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 11 2024
replicate

🎨 Fill in masked parts of images with FLUX.1-schnell 🖌️

Total runs: 6.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 16 2024
replicate

🎨AnimateDiff Prompt Travel🧭 Seamlessly Navigate and Animate Between Text-to-Image Prompts for Dynamic Visual Narratives

Total runs: 5.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:October 19 2023
replicate

FlashFace: Human Image Personalization with High-fidelity Identity Preservation

Total runs: 4.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:April 23 2024
replicate

Make realistic images of real people instantly (w/ ip-adapter-plus-face_sdxl_vit-h)

Total runs: 3.8K
Run Growth: 0
Growth Rate: 0.00%
Updated:July 15 2024
replicate

Upscale videos + images with BSRGAN

Total runs: 2.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:January 29 2025
replicate

Transform your portrait photos into any style or setting while preserving your facial identity

Total runs: 2.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:April 03 2025
replicate

MimicMotion: High-quality human motion video generation with pose-guided control

Total runs: 2.4K
Run Growth: 0
Growth Rate: 0.00%
Updated:July 16 2024
replicate

AuraSR: GAN-based Super-Resolution for real-world

Total runs: 2.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:June 28 2024
replicate

🖼️ Super fast 1.5B Image Captioning/VQA Multimodal LLM (Image-to-Text) 🖋️

Total runs: 2.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:February 02 2024
replicate

Idefics3-8B-Llama3, Answers questions and caption about images

Total runs: 2.1K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 15 2024
replicate

A state-of-the-art text-to-video generation model capable of creating high-quality videos with realistic motion from text descriptions

Total runs: 1.7K
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2024
replicate

Cubiq's ComfyUI InstantID node running `instantid_basic.json` example

Total runs: 1.6K
Run Growth: 0
Growth Rate: 0.00%
Updated:August 20 2024
replicate

🎼FluxMusic Text-to-Music Generation with Rectified Flow Transformer🎶

Total runs: 1.3K
Run Growth: 0
Growth Rate: 0.00%
Updated:September 26 2024
replicate

✨Stable Diffusion 3 w/ ⚡InstantX's Canny, Pose, and Tile ControlNets🖼️

Total runs: 1.2K
Run Growth: 0
Growth Rate: 0.00%
Updated:June 22 2024
replicate

Image tagger fine-tuned on WaifuDiffusion w/ (SwinV2, SwinV2, ConvNext, and ViT)

Total runs: 1000
Run Growth: 0
Growth Rate: 0.00%
Updated:May 22 2024
replicate

🫦 Realistic facial expression manipulation (lip-syncing) using audio or video

Total runs: 1000
Run Growth: 0
Growth Rate: 0.00%
Updated:June 12 2024
replicate

Unofficial Re-Trained AnimateAnyone (Image + DWPose Video → Animated Video of Image)

Total runs: 853
Run Growth: 0
Growth Rate: 0.00%
Updated:January 19 2024
replicate

🎙️Hololive text-to-speech and voice-to-voice (Japanese🇯🇵 + English🇬🇧)

Total runs: 850
Run Growth: 0
Growth Rate: 0.00%
Updated:June 04 2024
replicate

MEMO is a state-of-the-art open-weight model for audio-driven talking video generation.

Total runs: 678
Run Growth: 0
Growth Rate: 0.00%
Updated:December 11 2024
replicate

🐲 DragGAN 🐉 - "Drag Your GAN: Interactive Point-based Manipulation on the Generative Image Manifold"

Total runs: 583
Run Growth: 0
Growth Rate: 0.00%
Updated:July 07 2023
replicate

Easily create video datasets with auto-captioning for Hunyuan-Video LoRA finetuning

Total runs: 532
Run Growth: 0
Growth Rate: 0.00%
Updated:April 02 2025
replicate

Surrealist digital art featuring whimsical, anthropomorphic characters with exaggerated textures and vibrant color blocking

Total runs: 480
Run Growth: 0
Growth Rate: 0.00%
Updated:October 09 2024
replicate

Transform your text into a beautiful two-tone color gradient that represents your emotions.

Total runs: 417
Run Growth: 0
Growth Rate: 0.00%
Updated:June 06 2023
replicate

STAR Video Upscaler: Spatial-Temporal Augmentation with Text-to-Video Models for Real-World Video Super-Resolution

Total runs: 382
Run Growth: 0
Growth Rate: 0.00%
Updated:February 01 2025
replicate

Super High Quality Depth Maps 🗺️: An End-to-End Tile-Based Framework 🏗️ for High-Resolution Monocular Metric Depth Estimation 🔍📏

Total runs: 362
Run Growth: 0
Growth Rate: 0.00%
Updated:December 27 2023
replicate

Qwen 2: A 1.5 billion parameter language model from Alibaba Cloud, fine tuned for chat completions

Total runs: 207
Run Growth: 0
Growth Rate: 0.00%
Updated:June 26 2024
replicate

Qwen 2: A 0.5 billion parameter language model from Alibaba Cloud, fine tuned for chat completions

Total runs: 198
Run Growth: 0
Growth Rate: 0.00%
Updated:June 25 2024
replicate

Generates realistic talking face animations from a portrait image and audio using the CVPR 2025 Sonic model

Total runs: 148
Run Growth: 0
Growth Rate: 0.00%
Updated:April 03 2025
replicate

Powerful text-to-video model that generates high-quality videos up to 6 seconds at 15 FPS and 720p resolution from simple text prompt

Total runs: 128
Run Growth: 0
Growth Rate: 0.00%
Updated:October 23 2024
replicate

Convert speech in audio to text w/ `tiny`, `small`, `base`, and `large-v3` models

Total runs: 126
Run Growth: 0
Growth Rate: 0.00%
Updated:July 02 2024
replicate

SAMURAI: Adapting Segment Anything Model for Zero-Shot Visual Tracking with Motion-Aware Memory

Total runs: 100
Run Growth: 0
Growth Rate: 0.00%
Updated:November 28 2024
replicate

Generate high-quality videos from text prompts using StepVideo

Total runs: 93
Run Growth: 0
Growth Rate: 0.00%
Updated:February 25 2025
replicate

🗣️ TalkNet-ASD: Detect who is speaking in a video

Total runs: 92
Run Growth: 0
Growth Rate: 0.00%
Updated:May 02 2024
replicate

A "Hello World" model for me to get to grips with `cog` and Replicate

Total runs: 44
Run Growth: 0
Growth Rate: 0.00%
Updated:June 06 2023
replicate

Cost-optimized MMAudio V2 (T4 GPU): Add sound to video using this version running on T4 hardware for lower cost. Synthesizes high-quality audio from video content.

Total runs: 21
Run Growth: 0
Growth Rate: 0.00%
Updated:April 02 2025
replicate

SAM 2: Segment Anything v2 (for in Images + Videos)

Total runs: 19
Run Growth: 0
Growth Rate: 0.00%
Updated:July 31 2024
replicate

Hibiki: High-Fidelity Simultaneous Speech-To-Speech Translation

Total runs: 12
Run Growth: 0
Growth Rate: 0.00%
Updated:February 11 2025
replicate

Remove background from images using BRIA-RMBG-2.0

Total runs: 2
Run Growth: 0
Growth Rate: 0.00%
Updated:November 25 2024