|
--- |
|
library_name: transformers |
|
language: |
|
- la |
|
- en |
|
datasets: |
|
- hathibelagal/clean_latin |
|
base_model: |
|
- meta-llama/Llama-3.2-3B |
|
--- |
|
|
|
# Model Card for Llama-3.2-Latin |
|
|
|
`hathibelagal/llama-3.2-latin` is a finetuned version of the LLaMA-3.2-3B model, optimized for generating and understanding Latin text across various historical periods, from ancient to modern Neo-Latin. |
|
At this point, it generates content with accurate use of tenses (e.g., pluperfect, subjunctive), cases, and complex structures (e.g., concessive, temporal clauses). |
|
|
|
**Intended Use** |
|
|
|
- Suitable for tasks involving Latin text generation, translation, or analysis, such as generating Classical Latin prose, completing sentences, or aiding in Latin education. Best for short, context-specific prompts due to coherence limitations. |
|
- Not recommended for long-form narrative generation or tasks requiring strict contextual consistency until coherence improves. |
|
|
|
**Ethical Considerations** |
|
|
|
- Bias: The model may reflect biases in the training dataset, such as overrepresentation of certain Latin styles (e.g., ecclesiastical Latin) leading to tonal shifts in output. |
|
- Usage: Generated text should be reviewed for accuracy, especially in educational or scholarly contexts. |
|
|
|
## Usage Example |
|
|
|
```python |
|
from transformers import AutoTokenizer, AutoModelForCausalLM |
|
import torch |
|
|
|
repo_id = "hathibelagal/llama-3.2-latin" |
|
|
|
tokenizer = AutoTokenizer.from_pretrained(repo_id) |
|
model = AutoModelForCausalLM.from_pretrained( |
|
repo_id, |
|
torch_dtype=torch.float16, |
|
device_map="auto" |
|
) |
|
|
|
prompt = "Libellus vere aureus" |
|
inputs = tokenizer.encode(prompt, return_tensors="pt") |
|
inputs = inputs.to(model.device) |
|
|
|
outputs = model.generate( |
|
inputs, |
|
max_new_tokens=100, |
|
do_sample=True, |
|
top_p=0.9, |
|
temperature=0.6, |
|
repetition_penalty=1.2 |
|
) |
|
|
|
print(tokenizer.batch_decode( |
|
outputs, skip_special_tokens=True)[0]) |
|
``` |