Giter Site home page Giter Site logo

Comments (22)

thethiny avatar thethiny commented on June 5, 2024 3

Fair enough. If anyone wants to add support to CentOS in the makefile. They can raise a PR. Or if I get time, I will replicate it with docker and add it.

For now I will close this Issue. Please feel free to reopen.

FROM centos:7

# Install development tools
RUN yum groupinstall -y "Development Tools"

# Build CMake 3
RUN yum install -y epel-release wget
RUN wget https://cmake.org/files/v3.26/cmake-3.26.0.tar.gz && tar zxvf cmake-3.* \
    && cd cmake-3.* && ./bootstrap --prefix=/usr/local \
    && make -j$(nproc) && make install && cmake --version

# Install GCC and G++
RUN yum install -y centos-release-scl && yum install -y devtoolset-10-gcc* devtoolset-10-binutils

# Configure
RUN alternatives --install /usr/bin/gcc gcc /opt/rh/devtoolset-10/root/usr/bin/gcc 30 && \
    alternatives --install /usr/bin/g++ g++ /opt/rh/devtoolset-10/root/usr/bin/g++ 30 && \
    alternatives --install /usr/bin/cc cc /opt/rh/devtoolset-10/root/usr/bin/gcc 30 && \
    alternatives --install /usr/bin/c++ c++ /opt/rh/devtoolset-10/root/usr/bin/g++ 30 && \
    alternatives --set cc /opt/rh/devtoolset-10/root/usr/bin/gcc && \
    alternatives --set c++ /opt/rh/devtoolset-10/root/usr/bin/g++

# Install Python 3.8
RUN yum install -y centos-release-scl-rh && \
    yum install -y rh-python38 && \
    ln -s /opt/rh/rh-python38/root/usr/bin/python3.8 /usr/bin/python3

WORKDIR /app
RUN yum install -y git && git clone https://github.com/PotatoSpudowski/fastLLaMa.git /app

COPY now/CMakeLists.txt /app/CMakeLists.txt
COPY now/Makefile /app/

ENV CC=/opt/rh/devtoolset-10/root/usr/bin/gcc
ENV CXX=/opt/rh/devtoolset-10/root/usr/bin/g++
RUN chmod +x build.sh && bash ./build.sh

RUN yum install -qy python3-pip
RUN python3.8 -m pip install --upgrade pip && python3.8 -m pip install setuptools-rust
RUN python3.8 -m pip install -r requirements.txt

CMD ["python3.8", "example.py"]

You can start with this as my machine is slow to build so I'm unsure at which stage it will not work. Possibly have to swap dev toolset from 10 to 11.

from fastllama.

thethiny avatar thethiny commented on June 5, 2024 2

@imranraad07 add
CFLAGS += -D_POSIX_C_SOURCE=199309L
to line 160 in Makefile.
@PotatoSpudowski you need to add support in the Makefile for CentOS if you like.

from fastllama.

amitsingh19975 avatar amitsingh19975 commented on June 5, 2024 2

try to export CC and CXX with latest gcc toolchain.

export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
cmake ..
make

from fastllama.

thethiny avatar thethiny commented on June 5, 2024 2

While I appreciate the enthusiasm, the fix I provided will work for his scenario based on his environment (I replicated it with Docker). So adding that line for everyone will produce issues that will not work, unless ofcourse it's added in a define in the Makefile which unfortunately don't know how to do. If anyone's willing to do that he must handle the Makefile correctly. ๐Ÿ™๐Ÿป

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024 1

Thanks @amitsingh19975! It worked.

from fastllama.

thethiny avatar thethiny commented on June 5, 2024 1

Added CentOS (RHEL) support in #11

from fastllama.

PotatoSpudowski avatar PotatoSpudowski commented on June 5, 2024

Hi can you please tell me the steps you used so I can better understand?

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

Upon checking, I actually got error earlier from the make command before the cmake:

I llama.cpp build info:
I UNAME_S:  Linux
I UNAME_P:  x86_64
I UNAME_M:  x86_64
I CFLAGS:   -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -mavx -mavx2 -mfma -mf16c -msse3
I CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthread
I LDFLAGS:
I CC:       cc (GCC) 11.2.0
I CXX:      g++ (GCC) 11.3.0

cc  -I.              -O3 -DNDEBUG -std=c11   -fPIC -pthread -mavx -mavx2 -mfma -mf16c -msse3   -c ggml.c -o ggml.o
ggml.c: In function 'ggml_time_ms':
ggml.c:309:21: error: storage size of 'ts' isn't known
  309 |     struct timespec ts;
      |                     ^~
ggml.c:310:5: warning: implicit declaration of function 'clock_gettime' [-Wimplicit-function-declaration]
  310 |     clock_gettime(CLOCK_MONOTONIC, &ts);
      |     ^~~~~~~~~~~~~
ggml.c:310:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  310 |     clock_gettime(CLOCK_MONOTONIC, &ts);
      |                   ^~~~~~~~~~~~~~~
ggml.c:310:19: note: each undeclared identifier is reported only once for each function it appears in
ggml.c: In function 'ggml_time_us':
ggml.c:315:21: error: storage size of 'ts' isn't known
  315 |     struct timespec ts;
      |                     ^~
ggml.c:316:19: error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
  316 |     clock_gettime(CLOCK_MONOTONIC, &ts);
      |                   ^~~~~~~~~~~~~~~
make: *** [ggml.o] Error 1
Unable to build static library 'libllama'

from fastllama.

raldebsi avatar raldebsi commented on June 5, 2024

use my docker, however you will need to install python3.6m since I didn't add it to my docker

FROM ubuntu:18.04

# Add GCC and G++ New
RUN apt-get update && apt-get install software-properties-common curl git -qy 
RUN add-apt-repository ppa:ubuntu-toolchain-r/test && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 42D5A192B819C5DA

# Add CMAKE New
RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /etc/apt/trusted.gpg.d/kitware.gpg >/dev/null
RUN apt-add-repository "deb https://apt.kitware.com/ubuntu/ bionic main" && apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6AF7F09730B3F0A4

RUN apt-get update

# Install
RUN apt-get install -qy cmake gcc-10 g++-10

# Configure
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 30 && update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-10 30
RUN update-alternatives --install /usr/bin/cc cc /usr/bin/gcc 30 && update-alternatives --set cc /usr/bin/gcc
RUN update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++ 30 && update-alternatives --set c++ /usr/bin/g++


WORKDIR /app
RUN git clone https://github.com/PotatoSpudowski/fastLLaMa.git /app
RUN apt-get install -qy python3-distutils
RUN chmod +x build.sh && bash ./build.sh

RUN pip install -r requirements.txt

CMD ["python", "example.py"]

from fastllama.

PotatoSpudowski avatar PotatoSpudowski commented on June 5, 2024

Hi @raldebsi

This is quite helpful. Would you mind adding this docker file to the repo?
I can merge it!

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

Thanks, @raldebsi. Unfortunately, I don't have permission to install/update anything on the server. I am wondering whether I can run it in the current configuration.

from fastllama.

raldebsi avatar raldebsi commented on June 5, 2024

Hi @raldebsi

This is quite helpful. Would you mind adding this docker file to the repo? I can merge it!

Hi,
I would advise to get a different version that starts from new ubuntu (like 20) since my docker is too old I was not able to pull that. So if that's not possible let me know so that I can properly share the same docker as a PR later.

Thanks, @raldebsi. Unfortunately, I don't have permission to install/update anything on the server. I am wondering whether I can run it in the current configuration.

In that case you can try modifying the MakeFile and manually adding LibLlama a file.

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

Can you please share the libllama.a file? @raldebsi @PotatoSpudowski

Or this need to build locally?

from fastllama.

raldebsi avatar raldebsi commented on June 5, 2024

@imranraad07 it needs to be built for your own machine and for you version of python. What python are you using and what is your OS?

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

Python 3.8.10

and GNU/Linux (gnu linux 3.10.0-1160.81.1.el7.x86_64)

from fastllama.

raldebsi avatar raldebsi commented on June 5, 2024

Is this CentOS or Debian build? (My linux is not that much in terms of other Distros)

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

CentOS Linux

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

Thanks @thethiny. Worked like a charm!!

However, new error when running make after cmake ...

Do you know why is this?

[ 50%] Building CXX object CMakeFiles/fastLlama.dir/bridge.cpp.o

/home/imranm3/fastLLaMa/bridge.cpp: In function โ€˜bool llama_model_load(const string&, llama_model&, gpt_vocab&, int)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:96:53: error: use of deleted function โ€˜std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)โ€™
     auto fin = std::ifstream(fname, std::ios::binary);
                                                     ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:427:11: note: โ€˜std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function โ€˜std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)โ€™
In file included from /usr/include/c++/4.8.2/fstream:38:0,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/istream:58:11: note: โ€˜std::basic_istream<char>::basic_istream(const std::basic_istream<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_istream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/istream:58:11: error: use of deleted function โ€˜std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)โ€™
In file included from /usr/include/c++/4.8.2/ios:44:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/bits/basic_ios.h:66:11: note: โ€˜std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_ios : public ios_base
           ^
In file included from /usr/include/c++/4.8.2/ios:42:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/bits/ios_base.h:786:5: error: โ€˜std::ios_base::ios_base(const std::ios_base&)โ€™ is private
     ios_base(const ios_base&);
     ^
In file included from /usr/include/c++/4.8.2/ios:44:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/bits/basic_ios.h:66:11: error: within this context
     class basic_ios : public ios_base
           ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function โ€˜std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)โ€™
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function โ€˜std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)โ€™
/usr/include/c++/4.8.2/fstream:72:11: note: โ€˜std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
In file included from /usr/include/c++/4.8.2/ios:43:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/streambuf:802:7: error: โ€˜std::basic_streambuf<_CharT, _Traits>::basic_streambuf(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]โ€™ is private
       basic_streambuf(const basic_streambuf& __sb)
       ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:72:11: error: within this context
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
/home/imranm3/fastLLaMa/bridge.cpp:333:13: error: use of deleted function โ€˜std::basic_ifstream<char>& std::basic_ifstream<char>::operator=(const std::basic_ifstream<char>&)โ€™
         fin = std::ifstream(fname_part, std::ios::binary);
             ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:427:11: note: โ€˜std::basic_ifstream<char>& std::basic_ifstream<char>::operator=(const std::basic_ifstream<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function โ€˜std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)โ€™
In file included from /usr/include/c++/4.8.2/fstream:38:0,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/istream:58:11: note: โ€˜std::basic_istream<char>& std::basic_istream<char>::operator=(const std::basic_istream<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_istream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/istream:58:11: error: use of deleted function โ€˜std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)โ€™
In file included from /usr/include/c++/4.8.2/ios:44:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/bits/basic_ios.h:66:11: note: โ€˜std::basic_ios<char>& std::basic_ios<char>::operator=(const std::basic_ios<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_ios : public ios_base
           ^
In file included from /usr/include/c++/4.8.2/ios:42:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/bits/ios_base.h:789:5: error: โ€˜std::ios_base& std::ios_base::operator=(const std::ios_base&)โ€™ is private
     operator=(const ios_base&);
     ^
In file included from /usr/include/c++/4.8.2/ios:44:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/bits/basic_ios.h:66:11: error: within this context
     class basic_ios : public ios_base
           ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:427:11: error: use of deleted function โ€˜std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std::basic_filebuf<char>&)โ€™
     class basic_ifstream : public basic_istream<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/fstream:72:11: note: โ€˜std::basic_filebuf<char>& std::basic_filebuf<char>::operator=(const std::basic_filebuf<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
In file included from /usr/include/c++/4.8.2/ios:43:0,
                 from /usr/include/c++/4.8.2/istream:38,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/streambuf:810:7: error: โ€˜std::basic_streambuf<_CharT, _Traits>& std::basic_streambuf<_CharT, _Traits>::operator=(const std::basic_streambuf<_CharT, _Traits>&) [with _CharT = char; _Traits = std::char_traits<char>]โ€™ is private
       operator=(const basic_streambuf& __sb)
       ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:72:11: error: within this context
     class basic_filebuf : public basic_streambuf<_CharT, _Traits>
           ^
/home/imranm3/fastLLaMa/bridge.cpp: In function โ€˜bool llama_eval(const llama_model&, int, int, const std::vector<int>&, std::vector<float>&, size_t&)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:574:54: sorry, unimplemented: non-trivial designated initializers not supported
     struct ggml_cgraph gf = { .n_threads = n_threads };
                                                      ^
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜bool FastLlama::save_state(const string&)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:821:57: error: use of deleted function โ€˜std::basic_ofstream<char>::basic_ofstream(const std::basic_ofstream<char>&)โ€™
         auto file = std::ofstream(path, std::ios::binary);
                                                         ^
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:599:11: note: โ€˜std::basic_ofstream<char>::basic_ofstream(const std::basic_ofstream<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_ofstream : public basic_ostream<_CharT,_Traits>
           ^
/usr/include/c++/4.8.2/fstream:599:11: error: use of deleted function โ€˜std::basic_ostream<char>::basic_ostream(const std::basic_ostream<char>&)โ€™
In file included from /usr/include/c++/4.8.2/istream:39:0,
                 from /usr/include/c++/4.8.2/fstream:38,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/ostream:58:11: note: โ€˜std::basic_ostream<char>::basic_ostream(const std::basic_ostream<char>&)โ€™ is implicitly deleted because the default definition would be ill-formed:
     class basic_ostream : virtual public basic_ios<_CharT, _Traits>
           ^
/usr/include/c++/4.8.2/ostream:58:11: error: use of deleted function โ€˜std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)โ€™
In file included from /home/imranm3/fastLLaMa/bridge.cpp:8:0:
/usr/include/c++/4.8.2/fstream:599:11: error: use of deleted function โ€˜std::basic_ios<char>::basic_ios(const std::basic_ios<char>&)โ€™
     class basic_ofstream : public basic_ostream<_CharT,_Traits>
           ^
/usr/include/c++/4.8.2/fstream:599:11: error: use of deleted function โ€˜std::basic_filebuf<char>::basic_filebuf(const std::basic_filebuf<char>&)โ€™
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜bool FastLlama::load_state(const string&)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:839:57: error: use of deleted function โ€˜std::basic_ifstream<char>::basic_ifstream(const std::basic_ifstream<char>&)โ€™
         auto file = std::ifstream(path, std::ios::binary);
                                                         ^
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜bool FastLlama::generate(std::function<void(const std::basic_string<char>&)>, std::size_t, float, float, float, std::string)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:898:38: error: missing template arguments before โ€˜(โ€™ token
         auto buffer = FastLlamaBuffer(m_vocab, stop_word.size() + 1, [&fn](std::string const s) {
                                      ^
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜void FastLlama::save_vec(std::ofstream&, const std::vector<_RealType>&) constโ€™:
/home/imranm3/fastLLaMa/bridge.cpp:938:23: error: โ€˜is_integral_vโ€™ is not a member of โ€˜stdโ€™
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                       ^
/home/imranm3/fastLLaMa/bridge.cpp:938:43: error: expected primary-expression before โ€˜>โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                           ^
/home/imranm3/fastLLaMa/bridge.cpp:938:45: error: expected primary-expression before โ€˜||โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                             ^
/home/imranm3/fastLLaMa/bridge.cpp:938:48: error: โ€˜is_floating_point_vโ€™ is not a member of โ€˜stdโ€™
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                                ^
/home/imranm3/fastLLaMa/bridge.cpp:938:74: error: expected primary-expression before โ€˜>โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                                                          ^
/home/imranm3/fastLLaMa/bridge.cpp:938:75: error: expected primary-expression before โ€˜)โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                                                           ^
/home/imranm3/fastLLaMa/bridge.cpp:938:75: error: expected โ€˜,โ€™ before โ€˜)โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:938:75: error: expected string-literal before โ€˜)โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜void FastLlama::save_vocab(std::ofstream&) constโ€™:
/home/imranm3/fastLLaMa/bridge.cpp:951:24: error: expected unqualified-id before โ€˜[โ€™ token
         for(auto const [k, v] : m_vocab.id_to_token) {
                        ^
/home/imranm3/fastLLaMa/bridge.cpp:951:24: error: expected โ€˜;โ€™ before โ€˜[โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:951:25: error: โ€˜kโ€™ was not declared in this scope
         for(auto const [k, v] : m_vocab.id_to_token) {
                         ^
/home/imranm3/fastLLaMa/bridge.cpp:951:28: error: โ€˜vโ€™ was not declared in this scope
         for(auto const [k, v] : m_vocab.id_to_token) {
                            ^
/home/imranm3/fastLLaMa/bridge.cpp: In lambda function:
/home/imranm3/fastLLaMa/bridge.cpp:951:31: error: expected โ€˜{โ€™ before โ€˜:โ€™ token
         for(auto const [k, v] : m_vocab.id_to_token) {
                               ^
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜void FastLlama::save_vocab(std::ofstream&) constโ€™:
/home/imranm3/fastLLaMa/bridge.cpp:951:31: error: expected โ€˜;โ€™ before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:951:31: error: expected primary-expression before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:951:31: error: expected โ€˜)โ€™ before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:951:31: error: expected primary-expression before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:951:31: error: expected โ€˜;โ€™ before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜void FastLlama::save_model(std::ofstream&)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:997:25: error: expected unqualified-id before โ€˜[โ€™ token
         for(auto const& [k, v] : m_model.tensors) {
                         ^
/home/imranm3/fastLLaMa/bridge.cpp:997:25: error: expected โ€˜;โ€™ before โ€˜[โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:997:26: error: โ€˜kโ€™ was not declared in this scope
         for(auto const& [k, v] : m_model.tensors) {
                          ^
/home/imranm3/fastLLaMa/bridge.cpp:997:29: error: โ€˜vโ€™ was not declared in this scope
         for(auto const& [k, v] : m_model.tensors) {
                             ^
/home/imranm3/fastLLaMa/bridge.cpp: In lambda function:
/home/imranm3/fastLLaMa/bridge.cpp:997:32: error: expected โ€˜{โ€™ before โ€˜:โ€™ token
         for(auto const& [k, v] : m_model.tensors) {
                                ^
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜void FastLlama::save_model(std::ofstream&)โ€™:
/home/imranm3/fastLLaMa/bridge.cpp:997:32: error: expected โ€˜;โ€™ before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:997:32: error: expected primary-expression before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:997:32: error: expected โ€˜)โ€™ before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:997:32: error: expected primary-expression before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:997:32: error: expected โ€˜;โ€™ before โ€˜:โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜void FastLlama::load_vec(std::ifstream&, std::vector<_RealType>&) constโ€™:
/home/imranm3/fastLLaMa/bridge.cpp:1074:23: error: โ€˜is_integral_vโ€™ is not a member of โ€˜stdโ€™
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                       ^
/home/imranm3/fastLLaMa/bridge.cpp:1074:43: error: expected primary-expression before โ€˜>โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                           ^
/home/imranm3/fastLLaMa/bridge.cpp:1074:45: error: expected primary-expression before โ€˜||โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                             ^
/home/imranm3/fastLLaMa/bridge.cpp:1074:48: error: โ€˜is_floating_point_vโ€™ is not a member of โ€˜stdโ€™
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                                ^
/home/imranm3/fastLLaMa/bridge.cpp:1074:74: error: expected primary-expression before โ€˜>โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                                                          ^
/home/imranm3/fastLLaMa/bridge.cpp:1074:75: error: expected primary-expression before โ€˜)โ€™ token
         static_assert(std::is_integral_v<T> || std::is_floating_point_v<T>);
                                                                           ^
/home/imranm3/fastLLaMa/bridge.cpp:1074:75: error: expected โ€˜,โ€™ before โ€˜)โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp:1074:75: error: expected string-literal before โ€˜)โ€™ token
/home/imranm3/fastLLaMa/bridge.cpp: In member function โ€˜std::string FastLlama::load_str(std::ifstream&) constโ€™:
/home/imranm3/fastLLaMa/bridge.cpp:1085:26: error: invalid conversion from โ€˜const char*โ€™ to โ€˜std::basic_istream<char>::char_type* {aka char*}โ€™ [-fpermissive]
         file.read(s.data(), sizeof(char) * len);
                          ^
In file included from /usr/include/c++/4.8.2/fstream:38:0,
                 from /home/imranm3/fastLLaMa/bridge.cpp:8:
/usr/include/c++/4.8.2/istream:486:7: error:   initializing argument 1 of โ€˜std::basic_istream<_CharT, _Traits>& std::basic_istream<_CharT, _Traits>::read(std::basic_istream<_CharT, _Traits>::char_type*, std::streamsize) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_istream<_CharT, _Traits>::char_type = char; std::streamsize = long int]โ€™ [-fpermissive]
       read(char_type* __s, streamsize __n);
       ^
make[2]: *** [CMakeFiles/fastLlama.dir/bridge.cpp.o] Error 1
make[1]: *** [CMakeFiles/fastLlama.dir/all] Error 2
make: *** [all] Error 2

from fastllama.

amitsingh19975 avatar amitsingh19975 commented on June 5, 2024

@imranraad07, what's the gcc or clang version you're using?

from fastllama.

imranraad07 avatar imranraad07 commented on June 5, 2024

gcc (GCC) 11.3.0

from fastllama.

PotatoSpudowski avatar PotatoSpudowski commented on June 5, 2024

@thethiny your fix for CentOS works!

Would you be interested in creating a pull request? :)

from fastllama.

PotatoSpudowski avatar PotatoSpudowski commented on June 5, 2024

Fair enough. If anyone wants to add support to CentOS in the makefile. They can raise a PR.
Or if I get time, I will replicate it with docker and add it.

For now I will close this Issue. Please feel free to reopen.

from fastllama.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.