Comments (5)
I'm experiencing the same issue currently.
AssertionError Traceback (most recent call last)
[<ipython-input-11-b81fe2153712>](https://localhost:8080/#) in <cell line: 1>()
----> 1 lcpp_llm = Llama(
2 model_path=model_path,
3 n_threads=2, # CPU cores
4 n_batch=512, # Consider amount of VRAM on system
5 n_gpu_layers=32 # Dependent on model and GPU RAM
[/usr/local/lib/python3.10/dist-packages/llama_cpp/llama.py](https://localhost:8080/#) in __init__(self, model_path, n_ctx, n_parts, n_gpu_layers, seed, f16_kv, logits_all, vocab_only, use_mmap, use_mlock, embedding, n_threads, n_batch, last_n_tokens_size, lora_base, lora_path, low_vram, tensor_split, rope_freq_base, rope_freq_scale, n_gqa, rms_norm_eps, mul_mat_q, verbose)
321 self.model_path.encode("utf-8"), self.params
322 )
--> 323 assert self.model is not None
324
325 if verbose:
AssertionError:
```
from largelanguagemodelsprojects.
Are you using the same model that was previously loaded?
from largelanguagemodelsprojects.
from largelanguagemodelsprojects.
!pip install -qq langchain wget
!pip install gguf #https://github.com/ggerganov/llama.cpp/tree/master/gguf-py
!git clone https://github.com/ggerganov/llama.cpp
!pip -qq install git+https://github.com/huggingface/transformers
#Assuming you are using a GPU
!CMAKE_ARGS="-DLLAMA_CUBLAS=on" FORCE_CMAKE=1 pip -qq install --upgrade --force-reinstall llama-cpp-python --no-cache-dir
from langchain.llms import LlamaCpp
from langchain.callbacks.manager import CallbackManager
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
Callbacks support token-wise streaming
callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
Verbose is required to pass to the callback manager
from huggingface_hub import hf_hub_download
repo_id="TheBloke/Llama-2-13B-GGML"; filename="llama-2-13b.ggmlv3.q5_1.bin"
hf_hub_download(
repo_id=repo_id, filename=filename,
local_dir="/content"
)
!python /content/llama.cpp/convert-llama-ggmlv3-to-gguf.py --input ls -t /content/*ggmlv3*.bin | head -1
--output ls -t /content/*ggmlv3*.bin | head -1
.gguf
filename=filename+".gguf"
n_gpu_layers = 32
n_batch = 512
n_threads=4
llm = LlamaCpp(
model_path="/content/"+filename,
n_threads=n_threads,
n_gpu_layers=n_gpu_layers,
n_batch=n_batch,
callback_manager=callback_manager,
n_ctx=2048,
temperature=0.8,
repeat_penalty=1.18,
top_p=1,
top_k=3,
max_tokens=256,
streaming=True,
#verbose=True,
)
from largelanguagemodelsprojects.
Thanks @Usamawahabkhan the solution works
from largelanguagemodelsprojects.
Related Issues (10)
- HTTP and OS Error HOT 1
- LangChain Error
- google palm embedding error
- llama-2-13b
- Output formatting is weird sometimes
- terminate called after throwing an instance of 'std::runtime_error' | what(): unexpectedly reached end of file | Aborted (core dumped)
- not able to Load the Fine Tuned Model and Run Inference in Fine_Tune_Llama_2_by_generating_data_from_the_LLM_OpenAI
- Number of tokens (525) exceeded maximum context length (512).
- Low Speed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from largelanguagemodelsprojects.