Text Generation
Transformers
TensorBoard
Safetensors
gemma2
Generated from Trainer
text-generation-inference
Instructions to use JuIm/ProGemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JuIm/ProGemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="JuIm/ProGemma")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("JuIm/ProGemma") model = AutoModelForCausalLM.from_pretrained("JuIm/ProGemma") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use JuIm/ProGemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "JuIm/ProGemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JuIm/ProGemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/JuIm/ProGemma
- SGLang
How to use JuIm/ProGemma with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "JuIm/ProGemma" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JuIm/ProGemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "JuIm/ProGemma" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "JuIm/ProGemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use JuIm/ProGemma with Docker Model Runner:
docker model run hf.co/JuIm/ProGemma
Update README.md
Browse files
README.md
CHANGED
|
@@ -12,36 +12,25 @@ should probably proofread and complete it, then remove this comment. -->
|
|
| 12 |
|
| 13 |
# ProGemma
|
| 14 |
|
| 15 |
-
This model is
|
| 16 |
|
| 17 |
-
|
| 18 |
|
| 19 |
-
|
| 20 |
|
| 21 |
-
|
| 22 |
|
| 23 |
-
|
| 24 |
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
|
| 29 |
-
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
The following hyperparameters were used during training:
|
| 34 |
-
- learning_rate: 0.001
|
| 35 |
-
- train_batch_size: 1
|
| 36 |
-
- eval_batch_size: 8
|
| 37 |
-
- seed: 42
|
| 38 |
-
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
|
| 39 |
-
- lr_scheduler_type: linear
|
| 40 |
-
- lr_scheduler_warmup_ratio: 0.4
|
| 41 |
-
- training_steps: 5000
|
| 42 |
-
|
| 43 |
-
### Training results
|
| 44 |
|
|
|
|
| 45 |
|
| 46 |
|
| 47 |
### Framework versions
|
|
|
|
| 12 |
|
| 13 |
# ProGemma
|
| 14 |
|
| 15 |
+
This is a custom configuration of Google's Gemma 2 model that is being pre-trained on amino acid sequences of lengths 0 to 512. I used the free version of Google Colab to train this model, so updates are made regularly as the model hits new checkpoints. As of 07.28.2024, the model has been trained on about 5% of the dataset.
|
| 16 |
|
| 17 |
+
The model generates amino acids on a letter-by-letter basis.
|
| 18 |
|
| 19 |
+
Current training loss is about 2.7. Preliminary evaluation of generated sequences on AlphaFold 3 shows pTM scores of ~0.4 and average pLLDT scores ~60. After training is complete, a proper evaluation will be done to see whether sequences result in proteins with a low free energy. Perplexity scores will also be calculated.
|
| 20 |
|
| 21 |
+
The purpose of this model was to see whether I could develop an alternative to NVIDIA's ProtGPT2. ProGemma also serves as a stepping stone to a new model that will also utilize control tags to generate proteins based on function.
|
| 22 |
|
| 23 |
+
To use this mode for yourself using the pipeline within the Transformers package, please see the code below:
|
| 24 |
|
| 25 |
+
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
|
| 26 |
|
| 27 |
+
model = AutoModelForCausalLM.from_pretrained("JuIm/ProGemma") tokenizer = AutoTokenizer.from_pretrained("JuIm/Amino-Acid-Sequence-Tokenizer")
|
| 28 |
|
| 29 |
+
progemma = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
| 30 |
|
| 31 |
+
sequence = progemma("bosM", top_k=950, max_length=100, num_return_sequences=1, do_sample=True, repetition_penalty=1.2, eos_token_id=21, pad_token_id=22, bos_token_id=20)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
print(sequence)
|
| 34 |
|
| 35 |
|
| 36 |
### Framework versions
|