Skip to content

Commit

Permalink
llama : add stdexcept header for std::runtime_error
Browse files Browse the repository at this point in the history
This commit adds the stdexcept header to llama-arch.cpp to allow the use
of std::runtime_error.
Currently the following compilation is generated:

```console
/work/ai/new-vision-api/src/llama-arch.cpp: In member function‘std::string BASE_TN_IMPL<Tname, Ttensor>::str() const [with Tname = llm_arch; Ttensor = llm_tensor; std::string = std::__cxx11::basic_string<char>]’:
/home/danbev/work/ai/new-vision-api/src/llama-arch.cpp:1544:20: error: ‘runtime_error’ is not a member of ‘std’
 1544 |         throw std::runtime_error(format("Cannot find tensor name mapping for arch %d", arch));
      |                    ^~~~~~~~~~~~~
```
  • Loading branch information
danbev committed Jan 20, 2025
1 parent 4a7ab89 commit a00646e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/llama-arch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <map>
#include <exception>
#include <stdexcept>

static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = {
{ LLM_ARCH_LLAMA, "llama" },
Expand Down

0 comments on commit a00646e

Please sign in to comment.