Skip to content

Support for Qwen added #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: v0.1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions configs/chat_config_24gb.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"model": "hugging-quants/Meta-Llama-3.1-70B-Instruct-AWQ-INT4",
"draft_model": "hugging-quants/Meta-Llama-3.1-8B-Instruct-AWQ-INT4",
"offload": true,
"model": "Qwen/Qwen2.5-3B-Instruct",
"draft_model": "Qwen/Qwen2.5-0.5B-Instruct",
"offload": false,
"max_length": 8192,
"num_cache_layers": 16,
"generation_length": 256,
Expand All @@ -14,5 +14,5 @@
"num_beams": 24,
"depth": 24,
"engine": "dynamic",
"template": "meta-llama3"
"template": "qwen"
}
4 changes: 4 additions & 0 deletions examples/generate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import os
import sys
# Find local UMbreLLa first
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))

os.environ["TOKENIZERS_PARALLELISM"] = "false"
from umbrella.models.auto_model import AutoModelLM
from umbrella.logging_config import setup_logger
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ transformers==4.47.0
huggingface-hub==0.27.0
transformers-stream-generator==0.0.5
optimum==1.23.3
autoawq==0.2.7.post3
autoawq-kernels==0.0.8
gradio
11 changes: 9 additions & 2 deletions umbrella/models/auto_model.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .llama import Llama, LlamaAwq, LlamaOffload, LlamaAwqOffload, LlamaCudagraph
from .qwen import Qwen, QwenOffload, QwenCudagraph

class AutoModelLM:
"""
Expand All @@ -15,6 +16,8 @@ class AutoModelLM:
"meta-llama/Llama-3.1-8B-Instruct": LlamaOffload,
"meta-llama/Meta-Llama-3-70B-Instruct": LlamaOffload,
"meta-llama/Meta-Llama-3-8B-Instruct": LlamaOffload,
"Qwen/Qwen2.5-3B-Instruct": QwenOffload,
"Qwen/Qwen2.5-0.5B-Instruct": QwenOffload
}

_MODEL_MAPPING = {
Expand All @@ -37,7 +40,9 @@ class AutoModelLM:
"Zhuominc/Coder-400M": Llama,
"Zhuominc/Coder-400M-IT": Llama,
"Zhuominc/FastCode-500M": Llama,
"InfiniAILab/CodeDrafter-500M": Llama
"InfiniAILab/CodeDrafter-500M": Llama,
"Qwen/Qwen2.5-3B-Instruct": Qwen,
"Qwen/Qwen2.5-0.5B-Instruct": Qwen
}

_CUDAGRAPH_MODEL_MAPPING = {
Expand All @@ -53,7 +58,9 @@ class AutoModelLM:
"Zhuominc/Coder-400M": LlamaCudagraph,
"Zhuominc/Coder-400M-IT": LlamaCudagraph,
"Zhuominc/FastCode-500M": LlamaCudagraph,
"InfiniAILab/CodeDrafter-500M": LlamaCudagraph
"InfiniAILab/CodeDrafter-500M": LlamaCudagraph,
"Qwen/Qwen2.5-3B-Instruct": QwenCudagraph,
"Qwen/Qwen2.5-0.5B-Instruct": QwenCudagraph
}

@classmethod
Expand Down
Loading