8000 llama.cpp/examples/embd-input/README.md at speculative-tree · lgrammel/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content
{"payload":{"allShortcutsEnabled":false,"fileTree":{"examples/embd-input":{"items":[{"name":".gitignore","path":"examples/embd-input/.gitignore","contentType":"file"},{"name":"CMakeLists.txt","path":"examples/embd-input/CMakeLists.txt","contentType":"file"},{"name":"README.md","path":"examples/embd-input/README.md","contentType":"file"},{"name":"embd-input-lib.cpp","path":"examples/embd-input/embd-input-lib.cpp","contentType":"file"},{"name":"embd-input-test.cpp","path":"examples/embd-input/embd-input-test.cpp","contentType":"file"},{"name":"embd-input.h","path":"examples/embd-input/embd-input.h","contentType":"file"},{"name":"embd_input.py","path":"examples/embd-input/embd_input.py","contentType":"file"},{"name":"llava.py","path":"examples/embd-input/llava.py","contentType":"file"},{"name":"minigpt4.py","path":"examples/embd-input/minigpt4.py","contentType":"file"},{"name":"panda_gpt.py","path":"examples/embd-input/panda_gpt.py","contentType":"file"}],"totalCount":10},"examples":{"items":[{"name":"baby-llama","path":"examples/baby-llama","contentType":"directory"},{"name":"batched-bench","path":"examples/batched-bench","contentType":"directory"},{"name":"batched.swift","path":"examples/batched.swift","contentType":"directory"},{"name":"batched","path":"examples/batched","contentType":"directory"},{"name":"beam-search","path":"examples/beam-search","contentType":"directory"},{"name":"benchmark","path":"examples/benchmark","contentType":"directory"},{"name":"convert-llama2c-to-ggml","path":"examples/convert-llama2c-to-ggml","contentType":"directory"},{"name":"embd-input","path":"examples/embd-input","contentType":"directory"},{"name":"embedding","path":"examples/embedding","contentType":"directory"},{"name":"export-lora","path":"examples/export-lora","contentType":"directory"},{"name":"finetune","path":"examples/finetune","contentType":"directory"},{"name":"gguf","path":"examples/gguf","contentType":"directory"},{"name":"gptneox-wip","path":"examples/gptneox-wip","contentType":"directory"},{"name":"infill","path":"examples/infill","contentType":"directory"},{"name":"jeopardy","path":"examples/jeopardy","contentType":"directory"},{"name":"llama-bench","path":"examples/llama-bench","contentType":"directory"},{"name":"llava","path":"examples/llava","contentType":"directory"},{"name":"main-cmake-pkg","path":"examples/main-cmake-pkg","contentType":"directory"},{"name":"main","path":"examples/main","contentType":"directory"},{"name":"metal","path":"examples/metal","contentType":"directory"},{"name":"parallel","path":"examples/parallel","contentType":"directory"},{"name":"perplexity","path":"examples/perplexity","contentType":"directory"},{"name":"quantize-stats","path":"examples/quantize-stats","contentType":"directory"},{"name":"quantize","path":"examples/quantize","contentType":"directory"},{"name":"save-load-state","path":"examples/save-load-state","contentType":"directory"},{"name":"server","path":"examples/server","contentType":"directory"},{"name":"simple","path":"examples/simple","contentType":"directory"},{"name":"speculative","path":"examples/speculative","contentType":"directory"},{"name":"train-text-from-scratch","path":"examples/train-text-from-scratch","contentType":"directory"},{"name":"CMakeLists.txt","path":"examples/CMakeLists.txt","contentType":"file"},{"name":"Miku.sh","path":"examples/Miku.sh","contentType":"file"},{"name":"alpaca.sh","path":"examples/alpaca.sh","contentType":"file"},{"name":"chat-13B.bat","path":"examples/chat-13B.bat","contentType":"file"},{"name":"chat-13B.sh","path":"examples/chat-13B.sh","contentType":"file"},{"name":"chat-persistent.sh","path":"examples/chat-persistent.sh","contentType":"file"},{"name":"chat-vicuna.sh","path":"examples/chat-vicuna.sh","contentType":"file"},{"name":"chat.sh","path":"examples/chat.sh","contentType":"file"},{"name":"gpt4all.sh","path":"examples/gpt4all.sh","contentType":"file"},{"name":"json-schema-to-grammar.py","path":"examples/json-schema-to-grammar.py","contentType":"file"},{"name":"llama.vim","path":"examples/llama.vim","contentType":"file"},{"name":"llama2-13b.sh","path":"examples/llama2-13b.sh","contentType":"file"},{"name":"llama2.sh","path":"examples/llama2.sh","contentType":"file"},{"name":"llm.vim","path":"examples/llm.vim","contentType":"file"},{"name":"make-ggml.py","path":"examples/make-ggml.py","contentType":"file"},{"name":"reason-act.sh","path":"examples/reason-act.sh","contentType":"file"},{"name":"server-llama2-13B.sh","path":"examples/server-llama2-13B.sh","contentType":"file"}],"totalCount":46},"":{"items":[{"name":".devops","path":".devops","contentType":"directory"},{"name":".github","path":".github","contentType":"directory"},{"name":"ci","path":"ci","contentType":"directory"},{"name":"common","path":"common","contentType":"directory"},{"name":"docs","path":"docs","contentType":"directory"},{"name":"examples","path":"examples","contentType":"directory"},{"name":"gguf-py","path":"gguf-py","contentType":"directory"},{"name":"grammars","path":"grammars","contentType":"directory"},{"name":"media","path":"media","contentType":"directory"},{"name":"models","path":"models","contentType":"directory"},{"name":"pocs","path":"pocs","contentType":"directory"},{"name":"prompts","path":"prompts","contentType":"directory"},{"name":"scripts","path":"scripts","contentType":"directory"},{"name":"spm-headers","path":"spm-headers","contentType":"directory"},{"name":"tests","path":"tests","contentType":"directory"},{"name":".clang-tidy","path":".clang-tidy","contentType":"file"},{"name":".dockerignore","path":".dockerignore","contentType":"file"},{"name":".ecrc","path":".ecrc","contentType":"file"},{"name":".editorconfig","path":".editorconfig","contentType":"file"},{"name":".flake8","path":".flake8","contentType":"file"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":".pre-commit-config.yaml","path":".pre-commit-config.yaml","contentType":"file"},{"name":"CMakeLists.txt","path":"CMakeLists.txt","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"Package.swift","path":"Package.swift","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"SHA256SUMS","path":"SHA256SUMS","contentType":"file"},{"name":"build.zig","path":"build.zig","contentType":"file"},{"name":"codecov.yml","path":"codecov.yml","contentType":"file"},{"name":"convert-baichuan-hf-to-gguf.py","path":"convert-baichuan-hf-to-gguf.py","contentType":"file"},{"name":"convert-bloom-hf-to-gguf.py","path":"convert-bloom-hf-to-gguf.py","contentType":"file"},{"name":"convert-falcon-hf-to-gguf.py","path":"convert-falcon-hf-to-gguf.py","contentType":"file"},{"name":"convert-gptneox-hf-to-gguf.py","path":"convert-gptneox-hf-to-gguf.py","contentType":"file"},{"name":"convert-llama-ggml-to-gguf.py","path":"convert-llama-ggml-to-gguf.py","contentType":"file"},{"name":"convert-lora-to-ggml.py","path":"convert-lora-to-ggml.py","contentType":"file"},{"name":"convert-mpt-hf-to-gguf.py","path":"convert-mpt-hf-to-gguf.py","contentType":"file"},{"name":"convert-persimmon-to-gguf.py","path":"convert-persimmon-to-gguf.py","contentType":"file"},{"name":"convert-refact-hf-to-gguf.py","path":"convert-refact-hf-to-gguf.py","contentType":"file"},{"name":"convert-starcoder-hf-to-gguf.py","path":"convert-starcoder-hf-to-gguf.py","contentType":"file"},{"name":"convert.py","path":"convert.py","contentType":"file"},{"name":"flake.lock","path":"flake.lock","contentType":"file"},{"name":"flake.nix","path":"flake.nix","contentType":"file"},{"name":"ggml-alloc.c","path":"ggml-alloc.c","contentType":"file"},{"name":"ggml-alloc.h","path":"ggml-alloc.h","contentType":"file"},{"name":"ggml-backend.c","path":"ggml-backend.c","contentType":"file"},{"name":"ggml-backend.h","path":"ggml-backend.h","contentType":"file"},{"name":"ggml-cuda.cu","path":"ggml-cuda.cu","contentType":"file"},{"name":"ggml-cuda.h","path":"ggml-cuda.h","contentType":"file"},{"name":"ggml-metal.h","path":"ggml-metal.h","contentType":"file"},{"name":"ggml-metal.m","path":"ggml-metal.m","contentType":"file"},{"name":"ggml-metal.metal","path":"ggml-metal.metal","contentType":"file"},{"name":"ggml-mpi.c","path":"ggml-mpi.c","contentType":"file"},{"name":"ggml-mpi.h","path":"ggml-mpi.h","contentType":"file"},{"name":"ggml-opencl.cpp","path":"ggml-opencl.cpp","contentType":"file"},{"name":"ggml-opencl.h","path":"ggml-opencl.h","contentType":"file"},{"name":"ggml.c","path":"ggml.c","contentType":"file"},{"name":"ggml.h","path":"ggml.h","contentType":"file"},{"name":"k_quants.c","path":"k_quants.c","contentType":"file"},{"name":"k_quants.h","path":"k_quants.h","contentType":"file"},{"name":"llama.cpp","path":"llama.cpp","contentType":"file"},{"name":"llama.h","path":"llama.h","contentType":"file"},{"name":"mypy.ini","path":"mypy.ini","contentType":"file"},{"name":"requirements.txt","path":"requirements.txt","contentType":"file"},{"name":"run_with_preset.py","path":"run_with_preset.py","contentType":"file"},{"name":"unicode.h","path":"unicode.h","contentType":"file"}],"totalCount":66}},"fileTreeProcessingTime":37.774858,"foldersToFetch":[],"incompleteFileTree":false,"repo":{"id":740199949,"defaultBranch":"master","name":"llama.cpp","ownerLogin":"lgrammel","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2024-01-07T20:06:50.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/205036?v=4","public":true,"private":false,"isOrgOwned":false},"codeLineWrapEnabled":false,"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"speculative-tree","listCacheKey":"v0:1704658116.1838698","canEdit":false,"refType":"branch","currentOid":"ad2727d09143ea3931d4ad271baa7a1831a96d82"},"path":"examples/embd-input/README.md","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/lgrammel/llama.cpp/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"README.md","displayUrl":"https://github.com/lgrammel/llama.cpp/blob/speculative-tree/examples/embd-input/README.md?raw=true","headerInfo":{"blobSize":"2.18 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"5c4c75e","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2Flgrammel%2Fllama.cpp%2Fblob%2Fspeculative-tree%2Fexamples%2Fembd-input%2FREADME.md","isCSV":false,"isRichtext":true,"toc":[{"level":3,"text":"Examples for input embedding directly","anchor":"examples-for-input-embedding-directly","htmlText":"Examples for input embedding directly"},{"level":2,"text":"Requirement","anchor":"requirement","htmlText":"Requirement"},{"level":2,"text":"LLaVA example (llava.py)","anchor":"llava-example--llavapy","htmlText":"LLaVA example (llava.py)"},{"level":2,"text":"PandaGPT example (panda_gpt.py)","anchor":"pandagpt-example-panda_gptpy","htmlText":"PandaGPT example (panda_gpt.py)"},{"level":2,"text":"MiniGPT-4 example (minigpt4.py)","anchor":"minigpt-4-example-minigpt4py","htmlText":"MiniGPT-4 example (minigpt4.py)"}],"lineInfo":{"truncatedLoc":"63","truncatedSloc":"52"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"Markdown","languageID":222,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/lgrammel/llama.cpp/blob/speculative-tree/examples/embd-input/README.md","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/lgrammel/llama.cpp/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/lgrammel/llama.cpp/raw/refs/heads/speculative-tree/examples/embd-input/README.md","renderImageOrRaw":false,"richText":"\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch3 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eExamples for input embedding directly\u003c/h3\u003e\u003ca id=\"user-content-examples-for-input-embedding-directly\" class=\"anchor\" aria-label=\"Permalink: Examples for input embedding directly\" href=\"#examples-for-input-embedding-directly\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003eRequirement\u003c/h2\u003e\u003ca id=\"user-content-requirement\" class=\"anchor\" aria-label=\"Permalink: Requirement\" href=\"#requirement\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003cp dir=\"auto\"\u003ebuild \u003ccode\u003elibembdinput.so\u003c/code\u003e\nrun the following comman in main dir (../../).\u003c/p\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"make\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003emake\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca href=\"https://github.com/haotian-liu/LLaVA/\"\u003eLLaVA\u003c/a\u003e example (llava.py)\u003c/h2\u003e\u003ca id=\"user-content-llava-example--llavapy\" class=\"anchor\" aria-label=\"Permalink: LLaVA example (llava.py)\" href=\"#llava-example--llavapy\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eObtian LLaVA model (following \u003ca href=\"https://github.com/haotian-liu/LLaVA/\"\u003ehttps://github.com/haotian-liu/LLaVA/\u003c/a\u003e , use \u003ca href=\"https://huggingface.co/liuhaotian/LLaVA-13b-delta-v1-1/\" rel=\"nofollow\"\u003ehttps://huggingface.co/liuhaotian/LLaVA-13b-delta-v1-1/\u003c/a\u003e).\u003c/li\u003e\n\u003cli\u003eConvert it to ggml format.\u003c/li\u003e\n\u003cli\u003e\u003ccode\u003ellava_projection.pth\u003c/code\u003e is \u003ca href=\"https://huggingface.co/liuhaotian/LLaVA-13b-delta-v1-1/blob/main/pytorch_model-00003-of-00003.bin\" rel=\"nofollow\"\u003epytorch_model-00003-of-00003.bin\u003c/a\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"import torch\n\nbin_path = \u0026quot;../LLaVA-13b-delta-v1-1/pytorch_model-00003-of-00003.bin\u0026quot;\npth_path = \u0026quot;./examples/embd-input/llava_projection.pth\u0026quot;\n\ndic = torch.load(bin_path)\nused_key = [\u0026quot;model.mm_projector.weight\u0026quot;,\u0026quot;model.mm_projector.bias\u0026quot;]\ntorch.save({k: dic[k] for k in used_key}, pth_path)\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003eimport torch\n\nbin_path = \"../LLaVA-13b-delta-v1-1/pytorch_model-00003-of-00003.bin\"\npth_path = \"./examples/embd-input/llava_projection.pth\"\n\ndic = torch.load(bin_path)\nused_key = [\"model.mm_projector.weight\",\"model.mm_projector.bias\"]\ntorch.save({k: dic[k] for k in used_key}, pth_path)\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003col start=\"4\" dir=\"auto\"\u003e\n\u003cli\u003eCheck the path of LLaVA model and \u003ccode\u003ellava_projection.pth\u003c/code\u003e in \u003ccode\u003ellava.py\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca href=\"https://github.com/yxuansu/PandaGPT\"\u003ePandaGPT\u003c/a\u003e example (panda_gpt.py)\u003c/h2\u003e\u003ca id=\"user-content-pandagpt-example-panda_gptpy\" class=\"anchor\" aria-label=\"Permalink: PandaGPT example (panda_gpt.py)\" href=\"#pandagpt-example-panda_gptpy\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eObtian PandaGPT lora model from \u003ca href=\"https://github.com/yxuansu/PandaGPT\"\u003ehttps://github.com/yxuansu/PandaGPT\u003c/a\u003e. Rename the file to \u003ccode\u003eadapter_model.bin\u003c/code\u003e. Use \u003ca href=\"/lgrammel/llama.cpp/blob/speculative-tree/convert-lora-to-ggml.py\"\u003econvert-lora-to-ggml.py\u003c/a\u003e to convert it to ggml format.\nThe \u003ccode\u003eadapter_config.json\u003c/code\u003e is\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"{\n \u0026quot;peft_type\u0026quot;: \u0026quot;LORA\u0026quot;,\n \u0026quot;fan_in_fan_out\u0026quot;: false,\n \u0026quot;bias\u0026quot;: null,\n \u0026quot;modules_to_save\u0026quot;: null,\n \u0026quot;r\u0026quot;: 32,\n \u0026quot;lora_alpha\u0026quot;: 32,\n \u0026quot;lora_dropout\u0026quot;: 0.1,\n \u0026quot;target_modules\u0026quot;: [\u0026quot;q_proj\u0026quot;, \u0026quot;k_proj\u0026quot;, \u0026quot;v_proj\u0026quot;, \u0026quot;o_proj\u0026quot;]\n}\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003e{\n \"peft_type\": \"LORA\",\n \"fan_in_fan_out\": false,\n \"bias\": null,\n \"modules_to_save\": null,\n \"r\": 32,\n \"lora_alpha\": 32,\n \"lora_dropout\": 0.1,\n \"target_modules\": [\"q_proj\", \"k_proj\", \"v_proj\", \"o_proj\"]\n}\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003col start=\"2\" dir=\"auto\"\u003e\n\u003cli\u003ePapare the \u003ccode\u003evicuna\u003c/code\u003e v0 model.\u003c/li\u003e\n\u003cli\u003eObtain the \u003ca href=\"https://dl.fbaipublicfiles.com/imagebind/imagebind_huge.pth\" rel=\"nofollow\"\u003eImageBind\u003c/a\u003e model.\u003c/li\u003e\n\u003cli\u003eClone the PandaGPT source.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"git clone https://github.com/yxuansu/PandaGPT\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003egit clone https://github.com/yxuansu/PandaGPT\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003col start=\"5\" dir=\"auto\"\u003e\n\u003cli\u003eInstall the requirement of PandaGPT.\u003c/li\u003e\n\u003cli\u003eCheck the path of PandaGPT source, ImageBind model, lora model and vicuna model in panda_gpt.py.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\u003ch2 tabindex=\"-1\" class=\"heading-element\" dir=\"auto\"\u003e\u003ca href=\"https://github.com/Vision-CAIR/MiniGPT-4/\"\u003eMiniGPT-4\u003c/a\u003e example (minigpt4.py)\u003c/h2\u003e\u003ca id=\"user-content-minigpt-4-example-minigpt4py\" class=\"anchor\" aria-label=\"Permalink: MiniGPT-4 example (minigpt4.py)\" href=\"#minigpt-4-example-minigpt4py\"\u003e\u003csvg class=\"octicon octicon-link\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"\u003e\u003cpath d=\"m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z\"\u003e\u003c/path\u003e\u003c/svg\u003e\u003c/a\u003e\u003c/div\u003e\n\u003col dir=\"auto\"\u003e\n\u003cli\u003eObtain MiniGPT-4 model from \u003ca href=\"https://github.com/Vision-CAIR/MiniGPT-4/\"\u003ehttps://github.com/Vision-CAIR/MiniGPT-4/\u003c/a\u003e and put it in \u003ccode\u003eembd-input\u003c/code\u003e.\u003c/li\u003e\n\u003cli\u003eClone the MiniGPT-4 source.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cdiv class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"git clone https://github.com/Vision-CAIR/MiniGPT-4/\"\u003e\u003cpre class=\"notranslate\"\u003e\u003ccode\u003egit clone https://github.com/Vision-CAIR/MiniGPT-4/\n\u003c/code\u003e\u003c/pre\u003e\u003c/div\u003e\n\u003col start=\"3\" dir=\"auto\"\u003e\n\u003cli\u003eInstall the requirement of PandaGPT.\u003c/li\u003e\n\u003cli\u003ePapare the \u003ccode\u003evicuna\u003c/code\u003e v0 model.\u003c/li\u003e\n\u003cli\u003eCheck the path of MiniGPT-4 source, MiniGPT-4 model and vicuna model in \u003ccode\u003eminigpt4.py\u003c/code\u003e.\u003c/li\u003e\n\u003c/ol\u003e\n\u003c/article\u003e","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":false,"symbols":[{"name":"Examples for input embedding directly","kind":"section_3","ident_start":4,"ident_end":41,"extent_start":0,"extent_end":43,"fully_qualified_name":"Examples for input embedding directly","ident_utf16":{"start":{"line_number":0,"utf16_col":4},"end":{"line_number":0,"utf16_col":41}},"extent_utf16":{"start":{"line_number":0,"utf16_col":0},"end":{"line_number":2,"utf16_col":0}}},{"name":"Requirement","kind":"section_2","ident_start":46,"ident_end":57,"extent_start":43,"extent_end":144,"fully_qualified_name":"Requirement","ident_utf16":{"start":{"line_number":2,"utf16_col":3},"end":{"line_number":2,"utf16_col":14}},"extent_utf16":{"start":{"line_number":2,"utf16_col":0},"end":{"line_number":9,"utf16_col":0}}},{"name":"[LLaVA](https://github.com/haotian-liu/LLaVA/) example (llava.py)","kind":"section_2","ident_start":147,"ident_end":213,"extent_start":144,"extent_end":917,"fully_qualified_name":"[LLaVA](https://github.com/haotian-liu/LLaVA/) example (llava.py)","ident_utf16":{"start":{"line_number":9,"utf16_col":3},"end":{"line_number":9,"utf16_col":69}},"extent_utf16":{"start":{"line_number":9,"utf16_col":0},"end":{"line_number":28,"utf16_col":0}}},{"name":"[PandaGPT](https://github.com/yxuansu/PandaGPT) example (panda_gpt.py)","kind":"section_2","ident_start":920,"ident_end":990,"extent_start":917,"extent_end":1796,"fully_qualified_name":"[PandaGPT](https://github.com/yxuansu/PandaGPT) example (panda_gpt.py)","ident_utf16":{"start":{"line_number":28,"utf16_col":3},"end":{"line_number":28,"utf16_col":73}},"extent_utf16":{"start":{"line_number":28,"utf16_col":0},"end":{"line_number":53,"utf16_col":0}}},{"name":"[MiniGPT-4](https://github.com/Vision-CAIR/MiniGPT-4/) example (minigpt4.py)","kind":"section_2","ident_start":1799,"ident_end":1875,"extent_start":1796,"extent_end":2232,"fully_qualified_name":"[MiniGPT-4](https://github.com/Vision-CAIR/MiniGPT-4/) example (minigpt4.py)","ident_utf16":{"start":{"line_number":53,"utf16_col":3},"end":{"line_number":53,"utf16_col":79}},"extent_utf16":{"start":{"line_number":53,"utf16_col":0},"end":{"line_number":63,"utf16_col":0}}}]}},"copilotInfo":null,"copilotAccessAllowed":false,"modelsAccessAllowed":false,"modelsRepoIntegrationEnabled":false,"csrf_tokens":{"/lgrammel/llama.cpp/branches":{"post":"EqT5FnbhVx93ZmwB456xG5gq0O3HY6EXU94ucCaoRowMMq5Lqssp8Y_sLJAjBmhBqVA75wQ4mvwfp1Uj6laa7w"},"/repos/preferences":{"post":"fDQTxRSUCw0sP3Vw540M0fyIfFyQMN7pAbYHyi5qyMD4qBsl8BiwULsTQAWTnPD11QXOcDAt6DN5R1Ogfbnj6g"}}},"title":"llama.cpp/examples/embd-input/README.md at speculative-tree · lgrammel/llama.cpp","appPayload":{"helpUrl":"https://docs.github.com","findFileWorkerPath":"/assets-cdn/worker/find-file-worker-263cab1760dd.js","findInFileWorkerPath":"/assets-cdn/worker/find-in-file-worker-1b17b3e7786a.js","githubDevUrl":null,"enabled_features":{"code_nav_ui_events":false,"react_blob_overlay":false,"accessible_code_button":true}}}
0