Our new LangChain Academy Course Deep Research with LangGraph is now live! Enroll for free.
OSS (v1-alpha)
LangChain and LangGraph
pip install ctransformers
from langchain_community.llms import CTransformers
llm = CTransformers(model='/path/to/ggml-gpt-2.bin', model_type='gpt2') print(llm.invoke('AI is going to'))
illegal instruction
lib='avx'
lib='basic'
llm = CTransformers(model='/path/to/ggml-gpt-2.bin', model_type='gpt2', lib='avx')
llm = CTransformers(model='marella/gpt-2-ggml')
.bin
llm = CTransformers(model='marella/gpt-2-ggml', model_file='ggml-model.bin')
config
config = {'max_new_tokens': 256, 'repetition_penalty': 1.1} llm = CTransformers(model='marella/gpt-2-ggml', config=config)