Image-Text-to-Text
Transformers
Safetensors
Spanish
inkling2_loop
inkling-2-mini
spanish
conversational
Instructions to use Danielbrdz/Barcenas-Inkling-2-Mini with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Danielbrdz/Barcenas-Inkling-2-Mini with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Danielbrdz/Barcenas-Inkling-2-Mini") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Danielbrdz/Barcenas-Inkling-2-Mini") model = AutoModelForMultimodalLM.from_pretrained("Danielbrdz/Barcenas-Inkling-2-Mini", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Danielbrdz/Barcenas-Inkling-2-Mini with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Danielbrdz/Barcenas-Inkling-2-Mini" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Danielbrdz/Barcenas-Inkling-2-Mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Danielbrdz/Barcenas-Inkling-2-Mini
- SGLang
How to use Danielbrdz/Barcenas-Inkling-2-Mini 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 "Danielbrdz/Barcenas-Inkling-2-Mini" \ --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": "Danielbrdz/Barcenas-Inkling-2-Mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "Danielbrdz/Barcenas-Inkling-2-Mini" \ --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": "Danielbrdz/Barcenas-Inkling-2-Mini", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Danielbrdz/Barcenas-Inkling-2-Mini with Docker Model Runner:
docker model run hf.co/Danielbrdz/Barcenas-Inkling-2-Mini
Upload README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
base_model: unsloth/Inkling-2-Mini
|
| 3 |
+
datasets:
|
| 4 |
+
- OysterCoreAI/SFT-General-Spanish-50K
|
| 5 |
+
language:
|
| 6 |
+
- es
|
| 7 |
+
license: apache-2.0
|
| 8 |
+
library_name: transformers
|
| 9 |
+
pipeline_tag: image-text-to-text
|
| 10 |
+
tags:
|
| 11 |
+
- unsloth
|
| 12 |
+
- inkling-2-mini
|
| 13 |
+
- sft
|
| 14 |
+
- lora
|
| 15 |
+
- spanish
|
| 16 |
+
- merged-16bit
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# Barcenas Inkling 2 Mini — SFT en español
|
| 20 |
+
|
| 21 |
+
Modelo completo (**merged 16-bit**) de [`unsloth/Inkling-2-Mini`](https://huggingface.co/unsloth/Inkling-2-Mini) afinado con LoRA sobre
|
| 22 |
+
[`OysterCoreAI/SFT-General-Spanish-50K`](https://huggingface.co/datasets/OysterCoreAI/SFT-General-Spanish-50K), usando **solo la columna `messages`**.
|
| 23 |
+
|
| 24 |
+
## Detalles del entrenamiento
|
| 25 |
+
|
| 26 |
+
| Parámetro | Valor |
|
| 27 |
+
|---|---|
|
| 28 |
+
| Ejemplos | 2,000 (subconjunto de OysterCoreAI/SFT-General-Spanish-50K) |
|
| 29 |
+
| Pasos completados | 500 |
|
| 30 |
+
| Epochs | 1 (máx.) |
|
| 31 |
+
| Longitud máxima | 1024 tokens |
|
| 32 |
+
| LoRA | r=8, alpha=8, dropout=0 |
|
| 33 |
+
| Learning rate | 0.0001 |
|
| 34 |
+
| Batch efectivo | 4 |
|
| 35 |
+
| Precisión | 4-bit QLoRA (entrenamiento) → 16-bit (merge) |
|
| 36 |
+
| Framework | Unsloth |
|
| 37 |
+
|
| 38 |
+
Los expertos MoE se guardan en `bfloat16`; el resto de tensores conserva el dtype del checkpoint original.
|
| 39 |
+
Se usa el template de chat oficial de Inkling 2 Mini.
|
| 40 |
+
|
| 41 |
+
## Uso
|
| 42 |
+
|
| 43 |
+
```python
|
| 44 |
+
from unsloth import FastModel
|
| 45 |
+
|
| 46 |
+
model, tokenizer = FastModel.from_pretrained(
|
| 47 |
+
model_name = "Danielbrdz/Barcenas-Inkling-2-Mini",
|
| 48 |
+
max_seq_length = 2048,
|
| 49 |
+
load_in_4bit = True, # el checkpoint completo en 16-bit ocupa ~53 GB
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
+
messages = [{"role": "user", "content": "Hola, ¿me ayudas con una duda?"}]
|
| 53 |
+
inputs = tokenizer.apply_chat_template(
|
| 54 |
+
messages, add_generation_prompt=True, return_tensors="pt", return_dict=True,
|
| 55 |
+
reasoning_effort="none",
|
| 56 |
+
).to("cuda")
|
| 57 |
+
print(tokenizer.decode(model.generate(**inputs, max_new_tokens=256)[0][inputs["input_ids"].shape[1]:]))
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
> Entrenado sobre un subconjunto del dataset y con recursos limitados de Kaggle (T4 x2). Revisa las salidas antes de
|
| 61 |
+
> usarlo en producción.
|
| 62 |
+
|
| 63 |
+
Generado con el notebook de Unsloth para Inkling 2 Mini.
|