Skip to content

Commit

Permalink
Update initialization and README (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondWang0 authored Sep 9, 2023
1 parent 2f6d8df commit 19011b9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ Here, we provide step-by-step instructions to deploy LLaMA2-7B-chat with TinyCha
```bash
make chat -j
./chat
Using model: LLaMA7B_2_chat
Using LLaMA's default data format: INT4
TinyChatEngine by MIT HAN Lab: https://github.com/mit-han-lab/TinyChatEngine
Using model: LLaMA2_7B_chat
Using AWQ for 4bit quantization: https://github.com/mit-han-lab/llm-awq
Loading model... Finished!
USER: Write a syllabus for Operating Systems.
ASSISTANT:
Expand All @@ -103,7 +105,6 @@ Here, we provide step-by-step instructions to deploy LLaMA2-7B-chat with TinyCha
* Investigate security mechanisms to protect against malicious software attacks
* Analyze input/output (I/O) operations and their handling by the operating system
...
```

## Backend support
Expand Down
12 changes: 7 additions & 5 deletions llm/application/chat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ int main(int argc, char* argv[]) {
std::string target_data_format = "INT4";
Profiler::getInstance().for_demo = true;

std::cout << "TinyChatEngine by MIT HAN Lab: https://github.com/mit-han-lab/TinyChatEngine" << std::endl;

if (argc == 3) {
auto target_str = argv[1];
target_model = argv[1];
Expand All @@ -46,7 +48,7 @@ int main(int argc, char* argv[]) {
std::cerr << std::endl;
throw("Unsupported model\n");
}
std::cout << "Model: " << argv[1] << " selected" << std::endl;
std::cout << "Using model: " << argv[1] << std::endl;

auto data_format_input = argv[2];
if (data_format_list.count(data_format_input) == 0) {
Expand All @@ -60,9 +62,9 @@ int main(int argc, char* argv[]) {
}
target_data_format = argv[2];
if (target_data_format == "INT4" || target_data_format == "int4")
std::cout << "Data format: " << "AWQ " << argv[2] << " selected" << std::endl;
std::cout << "Using AWQ for 4bit quantization: https://github.com/mit-han-lab/llm-awq" << std::endl;
else
std::cout << "Data format: " << argv[2] << " selected" << std::endl;
std::cout << "Using data format: " << argv[2] << std::endl;
} else if (argc == 2) {
auto target_str = argv[1];
target_model = argv[1];
Expand All @@ -75,14 +77,14 @@ int main(int argc, char* argv[]) {
std::cerr << std::endl;
throw("Unsupported model\n");
}
std::cout << "Model: " << argv[1] << " selected" << std::endl;
std::cout << "Using model: " << argv[1] << std::endl;

auto data_format_input = "INT4";
} else {
if (isLLaMA(target_model)) {
std::cout << "Using model: " + target_model << std::endl;
if (target_data_format == "INT4" || target_data_format == "int4")
std::cout << "Using data format: " << "AWQ " << target_data_format << std::endl;
std::cout << "Using AWQ for 4bit quantization: https://github.com/mit-han-lab/llm-awq" << std::endl;
else
std::cout << "Using data format: " << target_data_format << std::endl;
} else { // OPT
Expand Down

0 comments on commit 19011b9

Please sign in to comment.