Views
No views yet
pip install torch transformers1import torch
2from transformers import pipeline
3
4pipe = pipeline("text-generation", model="jurgiraud/Llama-3.1-8B-Instruct_236K", torch_dtype=torch.bfloat16, device_map="auto")
5
6messages = [
7 {"role": "user", "content": "Translate from English to French in the bioinformatics domain. Provide only the translation:\nThe deletion of a gene may result in death or in a block of cell division."},
8]
9prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
10outputs = pipe(prompt, max_new_tokens=256, do_sample=False)
11print(outputs[0]["generated_text"])transformers SFTTrainer.<|begin_of_text|><|start_header_id|>system<|end_header_id|>
{context}<|eot_id|><|start_header_id|>user<|end_header_id|>
{question}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
{answer}<|eot_id|>r=8, lora_alpha=16, lora_dropout=0.05, target_modules=["q_proj", "v_proj", "o_proj"]1e-4, batch size = 4 (per device), gradient accumulation = 8paged_adamw_8bit| Models | BLEU↑ | chRF2↑ | TER↓ | COMET↑ |
|---|---|---|---|---|
| Baseline model Llama-3.1-8B-Instruct | 40.39 | 69.41 | 50.36 | 85.01 |
| Domain-adapted model Llama-3.1-8B-Instruct_236K | 44.57 | 71.44 | 45.68 | 85.55 |
1@phdthesis{giraud2026bioinformaticsMT,
2 title = {Developing Machine Translation for Bioinformatics: An Exploration into Domain-Specific Terminology, Domain Adaptation, and Evaluation},
3 author = {Giraud, Jurgi},
4 school = {The Open University},
5 year = {2026},
6 type = {Doctor of Philosophy ({PhD}) thesis},
7 doi = {10.21954/ou.ro.00109555},
8 url = {https://doi.org/10.21954/ou.ro.00109555},
9}