Instructions to use bertin-project/Gromenauer-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use bertin-project/Gromenauer-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="bertin-project/Gromenauer-7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("bertin-project/Gromenauer-7B") model = AutoModelForCausalLM.from_pretrained("bertin-project/Gromenauer-7B") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use bertin-project/Gromenauer-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "bertin-project/Gromenauer-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "bertin-project/Gromenauer-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/bertin-project/Gromenauer-7B
- SGLang
How to use bertin-project/Gromenauer-7B 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 "bertin-project/Gromenauer-7B" \ --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": "bertin-project/Gromenauer-7B", "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 "bertin-project/Gromenauer-7B" \ --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": "bertin-project/Gromenauer-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use bertin-project/Gromenauer-7B with Docker Model Runner:
docker model run hf.co/bertin-project/Gromenauer-7B
Create README.md
#1
by alvp - opened
README.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
datasets:
|
| 4 |
+
- fistro/gromenauer
|
| 5 |
+
language:
|
| 6 |
+
- es
|
| 7 |
+
pipeline_tag: text-generation
|
| 8 |
+
---
|
| 9 |
+
# Bertin-Gromenauer
|
| 10 |
+
|
| 11 |
+
<div align=center>
|
| 12 |
+
<img alt="BERTIN-gromenauer logo" src="https://huggingface.co/bertin-project/bertin-gromenauer/resolve/main/images/gromenauer.png" width="200px">
|
| 13 |
+
</div>
|
| 14 |
+
|
| 15 |
+
## Overview
|
| 16 |
+
|
| 17 |
+
Bertin-Gromenauer is a Spanish language model designed to understand and generate high-quality Spanish text. Developed using the robust Mistral architecture, this model has been trained on an extensive literary corpus, ensuring it captures a wide range of linguistic nuances, styles, and contexts found in Spanish literature.
|
| 18 |
+
## Model Details
|
| 19 |
+
|
| 20 |
+
- **Model Type**: Mistral
|
| 21 |
+
- **Sequence Length**: 8192
|
| 22 |
+
- **Hidden Dimension**: 4096
|
| 23 |
+
- **Intermediate Dimension**: 14336
|
| 24 |
+
- **Number of Layers**: 32
|
| 25 |
+
- **Number of Attention Heads**: 32
|
| 26 |
+
- **Number of Key-Value Heads**: 8
|
| 27 |
+
- **Activation Function**: SiLU
|
| 28 |
+
- **Initializer Range**: 0.02
|
| 29 |
+
- **Layer Norm Epsilon**: 1.0e-05
|
| 30 |
+
- **Use Flash Attention**: Yes
|
| 31 |
+
- **Gradient Checkpointing**: Enabled (Block Size: 5)
|
| 32 |
+
- **Sliding Window Attention**: 4096
|
| 33 |
+
- **Use Bias**: No
|
| 34 |
+
|
| 35 |
+
## Training Details
|
| 36 |
+
|
| 37 |
+
- **Tokenizer**: [mistralai/Mistral-7B-v0.1](https://huggingface.co/mistralai/Mistral-7B-v0.1)
|
| 38 |
+
- **Batch Size**: 512
|
| 39 |
+
- **Learning Rate**: 1e-5
|
| 40 |
+
- **Optimizer**: Adam with beta1=0.9, beta2=0.95, epsilon=1e-8
|
| 41 |
+
- **Weight Decay**: 0.1
|
| 42 |
+
- **Warmup Steps**: 200
|
| 43 |
+
- **Learning Rate Schedule**: Cosine
|
| 44 |
+
- **Number of Training Steps**: 7000
|
| 45 |
+
|
| 46 |
+
## Usage
|
| 47 |
+
|
| 48 |
+
To load the model in your project, you can use the following code:
|
| 49 |
+
|
| 50 |
+
```python
|
| 51 |
+
from transformers import AutoModel, AutoTokenizer
|
| 52 |
+
|
| 53 |
+
# Load the tokenizer
|
| 54 |
+
tokenizer = AutoTokenizer.from_pretrained("bertin-project/bertin-gromenauer")
|
| 55 |
+
|
| 56 |
+
# Load the model
|
| 57 |
+
model = AutoModel.from_pretrained("bertin-project/bertin-gromenauer")
|
| 58 |
+
|
| 59 |
+
# Example usage
|
| 60 |
+
text = "Introduce aquí tu texto en español."
|
| 61 |
+
inputs = tokenizer(text, return_tensors="pt")
|
| 62 |
+
outputs = model(**inputs)
|