langchain/docs/modules/models
Ravindra Marella b3988621c5
Add C Transformers for GGML Models (#5218)
# Add C Transformers for GGML Models
I created Python bindings for the GGML models:
https://github.com/marella/ctransformers

Currently it supports GPT-2, GPT-J, GPT-NeoX, LLaMA, MPT, etc. See
[Supported
Models](https://github.com/marella/ctransformers#supported-models).


It provides a unified interface for all models:

```python
from langchain.llms import CTransformers

llm = CTransformers(model='/path/to/ggml-gpt-2.bin', model_type='gpt2')

print(llm('AI is going to'))
```

It can be used with models hosted on the Hugging Face Hub:

```py
llm = CTransformers(model='marella/gpt-2-ggml')
```

It supports streaming:

```py
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler

llm = CTransformers(model='marella/gpt-2-ggml', callbacks=[StreamingStdOutCallbackHandler()])
```

Please see [README](https://github.com/marella/ctransformers#readme) for
more details.
---------

Co-authored-by: Dev 2049 <dev.dev2049@gmail.com>
2023-05-25 13:42:44 -07:00
..
chat Harrison/vertex (#5049) 2023-05-24 15:51:12 -07:00
llms Add C Transformers for GGML Models (#5218) 2023-05-25 13:42:44 -07:00
text_embedding/examples Added the option of specifying a proxy for the OpenAI API (#5246) 2023-05-25 09:50:25 -07:00
chat.rst big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
getting_started.ipynb change heading 2023-05-13 09:52:23 -07:00
llms.rst big docs refactor (#1978) 2023-03-26 19:49:46 -07:00
text_embedding.rst big docs refactor (#1978) 2023-03-26 19:49:46 -07:00