Instructions to use umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final") - Transformers
How to use umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final
- SGLang
How to use umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final 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 "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final with Docker Model Runner:
docker model run hf.co/umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,62 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
base_model: Qwen/Qwen2.5-0.5B-Instruct
|
| 3 |
library_name: peft
|
| 4 |
-
model_name:
|
|
|
|
| 5 |
tags:
|
| 6 |
-
- base_model:adapter:Qwen/Qwen2.5-0.5B-Instruct
|
| 7 |
-
- lora
|
| 8 |
-
- sft
|
| 9 |
-
-
|
| 10 |
-
-
|
|
|
|
|
|
|
| 11 |
licence: license
|
| 12 |
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
|
| 15 |
-
# Model Card for qwen2_5_lora_grupo3
|
| 16 |
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
```python
|
| 23 |
-
from transformers import
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
```
|
| 30 |
|
| 31 |
-
#
|
| 32 |
|
| 33 |
-
|
|
|
|
| 34 |
|
|
|
|
| 35 |
|
| 36 |
-
This model was trained
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
|
| 38 |
### Framework versions
|
| 39 |
|
| 40 |
-
- PEFT 0.18.1
|
| 41 |
-
- TRL: 0.27.2
|
| 42 |
-
- Transformers: 5.1.0
|
| 43 |
-
-
|
| 44 |
-
- Datasets: 4.5.0
|
| 45 |
- Tokenizers: 0.22.2
|
| 46 |
|
| 47 |
## Citations
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
```bibtex
|
| 54 |
-
@misc{vonwerra2022trl,
|
| 55 |
-
title = {{TRL: Transformer Reinforcement Learning}},
|
| 56 |
-
author = {Leandro von Werra and Younes Belkada and Lewis Tunstall and Edward Beeching and Tristan Thrush and Nathan Lambert and Shengyi Huang and Kashif Rasul and Quentin Gallou{\'e}dec},
|
| 57 |
-
year = 2020,
|
| 58 |
-
journal = {GitHub repository},
|
| 59 |
-
publisher = {GitHub},
|
| 60 |
-
howpublished = {\url{https://github.com/huggingface/trl}}
|
| 61 |
-
}
|
| 62 |
-
```
|
|
|
|
| 1 |
+
# GRUPO # 8
|
| 2 |
+
Integrantes:
|
| 3 |
+
- Sharon Añejandra Calcina
|
| 4 |
+
|
| 5 |
---
|
| 6 |
base_model: Qwen/Qwen2.5-0.5B-Instruct
|
| 7 |
library_name: peft
|
| 8 |
+
model_name: model_regulations-eu_grupo8-SharonCalcina_final
|
| 9 |
+
pipeline_tag: text-generation
|
| 10 |
tags:
|
| 11 |
+
- base_model:adapter:Qwen/Qwen2.5-0.5B-Instruct
|
| 12 |
+
- lora
|
| 13 |
+
- sft
|
| 14 |
+
- gdpr
|
| 15 |
+
- legal
|
| 16 |
+
- transformers
|
| 17 |
+
- trl
|
| 18 |
licence: license
|
| 19 |
pipeline_tag: text-generation
|
| 20 |
---
|
| 21 |
|
|
|
|
| 22 |
|
| 23 |
+
# GDPR Q&A – Qwen2.5 LoRA Model
|
| 24 |
+
|
| 25 |
+
This repository contains **LoRA adapters** fine-tuned on a **GDPR Question–Answering dataset**
|
| 26 |
+
derived from **Regulation (EU) 2016/679 (GDPR)**.
|
| 27 |
+
|
| 28 |
+
The model is intended for **educational and informational purposes only** and does **not**
|
| 29 |
+
provide legal advice.
|
| 30 |
+
|
| 31 |
+
---
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
## Academic Information
|
| 35 |
+
|
| 36 |
+
- **Course / Practice**: Fine-tuning & Distillation (GDPR QA)
|
| 37 |
+
- **Group**: **Grupo 8**
|
| 38 |
+
- **Students**:
|
| 39 |
+
- Sharon Alejandra Calcina
|
| 40 |
+
- **Organization**: `umsa-v1`
|
| 41 |
+
|
| 42 |
+
---
|
| 43 |
+
|
| 44 |
+
## Base Model
|
| 45 |
+
|
| 46 |
+
- **Base model**: `Qwen/Qwen2.5-0.5B-Instruct`
|
| 47 |
+
- **Fine-tuning method**: Supervised Fine-Tuning (SFT)
|
| 48 |
+
- **Adaptation**: LoRA (PEFT)
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
|
| 52 |
+
## Dataset
|
| 53 |
+
|
| 54 |
+
The model was trained using the following dataset:
|
| 55 |
+
|
| 56 |
+
https://huggingface.co/datasets/umsa-v1/dataset_regulations-eu_grupo8-SharonCalcina_final
|
| 57 |
+
|
| 58 |
+
The dataset contains GDPR-related question–answer pairs with paraphrased variants.
|
| 59 |
+
|
| 60 |
+
---
|
| 61 |
+
|
| 62 |
+
## Quick Start
|
| 63 |
|
| 64 |
```python
|
| 65 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 66 |
+
from peft import PeftModel
|
| 67 |
+
|
| 68 |
+
base_model = AutoModelForCausalLM.from_pretrained(
|
| 69 |
+
"Qwen/Qwen2.5-0.5B-Instruct",
|
| 70 |
+
device_map="auto"
|
| 71 |
+
)
|
| 72 |
+
|
| 73 |
+
model = PeftModel.from_pretrained(
|
| 74 |
+
base_model,
|
| 75 |
+
"umsa-v1/model_regulations-eu_grupo8-SharonCalcina_final"
|
| 76 |
+
)
|
| 77 |
+
|
| 78 |
+
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen2.5-0.5B-Instruct")
|
| 79 |
|
| 80 |
+
prompt = "What rights does a data subject have under GDPR?"
|
| 81 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 82 |
+
|
| 83 |
+
outputs = model.generate(**inputs, max_new_tokens=200)
|
| 84 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|
| 85 |
```
|
| 86 |
|
| 87 |
+
# Model Card for qwen2_5_lora_grupo3
|
| 88 |
|
| 89 |
+
This model is a fine-tuned version of [Qwen/Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct).
|
| 90 |
+
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 91 |
|
| 92 |
+
## Training procedure
|
| 93 |
|
| 94 |
+
This model was trained using **Supervised Fine-Tuning (SFT)** with a
|
| 95 |
+
Low-Rank Adaptation (LoRA) approach on top of the
|
| 96 |
+
Qwen/Qwen2.5-0.5B-Instruct base model.
|
| 97 |
+
The training data consists of GDPR-related question–answer pairs with
|
| 98 |
+
paraphrased variants.
|
| 99 |
|
| 100 |
### Framework versions
|
| 101 |
|
| 102 |
+
- PEFT: 0.18.1
|
| 103 |
+
- TRL: 0.27.2
|
| 104 |
+
- Transformers: 5.1.0
|
| 105 |
+
- PyTorch: 2.1.0
|
| 106 |
+
- Datasets: 4.5.0
|
| 107 |
- Tokenizers: 0.22.2
|
| 108 |
|
| 109 |
## Citations
|
| 110 |
|
| 111 |
+
author = {Sharon Calcina},
|
| 112 |
+
year = 2026,
|
| 113 |
+
howpublished = {huggingface repo}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|