File size: 3,884 Bytes
2e6976e d20b41b 1558cc7 2e6976e 9edaf2a d20b41b 7c53563 2e6976e d20b41b 2e6976e 9edaf2a d20b41b 2e6976e e2a3b12 d20b41b 2e6976e 1558cc7 2e6976e d20b41b 2e6976e d20b41b 2e6976e d20b41b 2a8ce94 2e6976e d20b41b 2e6976e d20b41b 2e6976e d20b41b 1558cc7 2e6976e d20b41b 2e6976e d20b41b 2e6976e d20b41b 2e6976e d20b41b 2e6976e d20b41b 2e6976e d20b41b 1558cc7 2e6976e 1558cc7 d20b41b 2e6976e d20b41b 2e6976e d20b41b 2e6976e 1932089 1558cc7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
---
library_name: transformers
base_model: meta-llama/Meta-Llama-3-8B
tags:
- biology
- medical
---
## Model Details
Protein-Llama-3-8B is a specialized version of the [Llama-3-8B](https://huggingface.co/meta-llama/Meta-Llama-3-8B) language model, fine-tuned for the task of protein language modeling.
This model has been continually pre-trained using [LoRA](https://huggingface.co/docs/diffusers/en/training/lora) technique on extensive datasets of protein sequences, enabling it to generate novel protein sequences based on natural language prompts.
It supports both uncontrollable and controllable protein generation, allowing users to specify desired characteristics for the proteins.
The model is designed to facilitate advancements in protein engineering, making it a valuable tool for drug development, chemical synthesis, and other biotechnological applications.
For full details please read [our paper](https://arxiv.org/abs/2411.05966).
### Model Description
Generating novel protein sequences possessing desired properties, termed as protein engineering, is crucial for industries like drug development and chemical synthesis. Traditional protein engineering techniques often involve introducing random mutations into the gene encoding the protein of interest. This is followed by expression and screening to identify variants with improved or novel functions, which are then reproduced. While effective, these approaches are labor-intensive and time-consuming, as they rely on iterating over known protein sequences. This limits their ability to generate diverse protein sequences with entirely new capabilities, as they are constrained by existing protein templates. Moreover, the need to analyze numerous protein variants can waste valuable experimental resources.
However, leveraging a Large Language Model (LLM) that has learned the "protein language" significantly accelerates this process. An LLM can generate and evaluate protein sequences in a matter of seconds. The inherent randomness of LLM-generated sequences enhances diversity, enabling the creation of completely novel proteins with potentially unprecedented functions. This not only streamlines the discovery and development process but also expands the scope of possibilities in protein engineering.
This model is based on the Llama-3-8B architecture and is capable of generating proteins based on user defined characteristics.
[Energy Efficient Protein Language Models: Leveraging Small Language Models with LoRA for Controllable Protein Generation](https://huggingface.co/papers/2411.05966)
## Usage
To download and use the Protein-Llama-3 model for inference, follow these steps:
### Installation
Ensure you have the `transformers` library installed. You can install it using pip:
```bash
pip install transformers
```
### Uncontrollable Generation
Uncontrollable generation can be handled via prompting the model with the phrase 'Seq=<'.
```
generator = pipeline('text-generation', model="Esperanto/Protein-Llama-3-8B")
sequences = generator("Seq=<",temperature=0.2,
top_k=40,
top_p=0.9,
do_sample=True,
repetition_penalty=1.2,
max_new_tokens=30,
num_return_sequences=500)
for sequence in sequences:
print(sequence['generated_text'])
```
### Controllable Generation
Controllable generation can be done by prompting the model with '[Generate xxx protein] Seq=<'. Here, xxx can be any family from the 10 classes supported by this model.
```
generator = pipeline('text-generation', model="Esperanto/Protein-Llama-3-8B")
sequences = generator("[Generate Ligase enzyme protein] Seq=<",temperature=0.2,
top_k=40,
top_p=0.9,
do_sample=True,
repetition_penalty=1.2,
max_new_tokens=30,
num_return_sequences=500)
for sequence in sequences:
print(sequence['generated_text'])
```
### Contributors
Aayush Shah, Shankar Jayaratnam |