日期:
来源:机器之心收集编辑:
Meta 发布的开源系列模型 LLaMA,将在开源社区的共同努力下发挥出极大的价值。
这些都得益于一个名为 llama.cpp 的新项目,该项目在 GitHub 上线三天,狂揽 4.6k star。
没有依赖项的普通 C/C++ 实现; Apple silicon first-class citizen—— 通过 Arm Neon 和 Accelerate 框架; AVX2 支持 x86 架构; 混合 F16 / F32 精度; 4-bit 量化支持; 在 CPU 上运行。
# build this repogit clone https://github.com/ggerganov/llama.cppcd llama.cppmake# obtain the original LLaMA model weights and place them in ./modelsls ./models65B 30B 13B 7B tokenizer_checklist.chk tokenizer.model# install Python dependenciespython3 -m pip install torch numpy sentencepiece# convert the 7B model to ggml FP16 formatpython3 convert-pth-to-ggml.py models/7B/ 1# quantize the model to 4-bits./quantize.sh 7B# run the inference./main -m ./models/7B/ggml-model-q4_0.bin -t 8 -n 128
./main -m ./models/13B/ggml-model-q4_0.bin -t 8 -n 256 --repeat_penalty 1.0 --color -i -r "User:" \-p \"Transcript of a dialog, where the User interacts with an Assistant named Bob. Bob is helpful, kind, honest, good at writing, and never fails to answer the User's requests immediately and with precision.User: Hello, Bob.Bob: Hello. How may I help you today?User: Please tell me the largest city in Europe.Bob: Sure. The largest city in Europe is Moscow, the capital of Russia.User:"
make -j && ./main -m ./models/7B/ggml-model-q4_0.bin -p "Building a website can be done in 10 simple steps:" -t 8 -n 512I llama.cpp build info:I UNAME_S: DarwinI UNAME_P: armI UNAME_M: arm64I CFLAGS: -I. -O3 -DNDEBUG -std=c11 -fPIC -pthread -DGGML_USE_ACCELERATEI CXXFLAGS: -I. -I./examples -O3 -DNDEBUG -std=c++11 -fPIC -pthreadI LDFLAGS: -framework AccelerateI CC: Apple clang version 14.0.0 (clang-1400.0.29.202)I CXX: Apple clang version 14.0.0 (clang-1400.0.29.202)make: Nothing to be done for `default'.main: seed = 1678486056llama_model_load: loading model from './models/7B/ggml-model-q4_0.bin' - please wait ...llama_model_load: n_vocab = 32000llama_model_load: n_ctx = 512llama_model_load: n_embd = 4096llama_model_load: n_mult = 256llama_model_load: n_head = 32llama_model_load: n_layer = 32llama_model_load: n_rot = 128llama_model_load: f16 = 2llama_model_load: n_ff = 11008llama_model_load: ggml ctx size = 4529.34 MBllama_model_load: memory_size = 512.00 MB, n_mem = 16384llama_model_load: .................................... donellama_model_load: model size = 4017.27 MB / num tensors = 291main: prompt: 'Building a website can be done in 10 simple steps:'main: number of tokens in prompt = 151 -> ''8893 -> 'Build'292 -> 'ing'263 -> ' a'4700 -> ' website'508 -> ' can'367 -> ' be'2309 -> ' done'297 -> ' in'29871 -> ' '29896 -> '1'29900 -> '0'2560 -> ' simple'6576 -> ' steps'29901 -> ':'sampling parameters: temp = 0.800000, top_k = 40, top_p = 0.950000Building a website can be done in 10 simple steps:1) Select a domain name and web hosting plan2) Complete a sitemap3) List your products4) Write product descriptions5) Create a user account6) Build the template7) Start building the website8) Advertise the website9) Provide email support10) Submit the website to search enginesA website is a collection of web pages that are formatted with HTML. HTML is the code that defines what the website looks like and how it behaves.The HTML code is formatted into a template or a format. Once this is done, it is displayed on the user's browser.The web pages are stored in a web server. The web server is also called a host. When the website is accessed, it is retrieved from the server and displayed on the user's computer.A website is known as a website when it is hosted. This means that it is displayed on a host. The host is usually a web server.A website can be displayed on different browsers. The browsers are basically the software that renders the website on the user's screen.A website can also be viewed on different devices such as desktops, tablets and smartphones.Hence, to have a website displayed on a browser, the website must be hosted.A domain name is an address of a website. It is the name of the website.The website is known as a website when it is hosted. This means that it is displayed on a host. The host is usually a web server.A website can be displayed on different browsers. The browsers are basically the software that renders the website on the user’s screen.A website can also be viewed on different devices such as desktops, tablets and smartphones. Hence, to have a website displayed on a browser, the website must be hosted.A domain name is an address of a website. It is the name of the website.A website is an address of a website. It is a collection of web pages that are formatted with HTML. HTML is the code that defines what the website looks like and how it behaves.The HTML code is formatted into a template or a format. Once this is done, it is displayed on the user’s browser.A website is known as a website when it is hostedmain: mem per token = 14434244 bytesmain: load time = 1332.48 msmain: sample time = 1081.40 msmain: predict time = 31378.77 ms / 61.41 ms per tokenmain: total time = 34036.74 ms
探寻隐私计算最新行业技术,「首届隐语开源社区开放日」报名启程
春暖花开之际,诚邀广大技术开发者&产业用户相聚活动现场,体验数智时代的隐私计算生态建设之旅,一站构建隐私计算产业体系知识:
隐私计算领域焦点之性
分布式计算系统的短板与升级策略
隐私计算跨平台互联互通
隐语开源框架金融行业实战经验
点击阅读原文,立即报名。
© THE END
转载请联系本公众号获得授权
投稿或寻求报道:content@jiqizhixin.com