Text Generation
Transformers
Safetensors
Spanish
English
llama
milox
from-scratch
conversational
text-generation-inference
Instructions to use blackdaqlabs/MiloX1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use blackdaqlabs/MiloX1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="blackdaqlabs/MiloX1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("blackdaqlabs/MiloX1") model = AutoModelForCausalLM.from_pretrained("blackdaqlabs/MiloX1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use blackdaqlabs/MiloX1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "blackdaqlabs/MiloX1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "blackdaqlabs/MiloX1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/blackdaqlabs/MiloX1
- SGLang
How to use blackdaqlabs/MiloX1 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 "blackdaqlabs/MiloX1" \ --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": "blackdaqlabs/MiloX1", "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 "blackdaqlabs/MiloX1" \ --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": "blackdaqlabs/MiloX1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use blackdaqlabs/MiloX1 with Docker Model Runner:
docker model run hf.co/blackdaqlabs/MiloX1
Delete README.md
Browse files
README.md
DELETED
|
@@ -1,44 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
language:
|
| 3 |
-
- es
|
| 4 |
-
- en
|
| 5 |
-
library_name: transformers
|
| 6 |
-
pipeline_tag: text-generation
|
| 7 |
-
license: other
|
| 8 |
-
tags:
|
| 9 |
-
- milox
|
| 10 |
-
- from-scratch
|
| 11 |
-
- llama
|
| 12 |
-
---
|
| 13 |
-
|
| 14 |
-
# MiloX
|
| 15 |
-
|
| 16 |
-
**MiloX** es un modelo de lenguaje tipo GPT (Transformer decoder, arquitectura Llama: RMSNorm + RoPE + SwiGLU + GQA)
|
| 17 |
-
de **30M par谩metros**, **preentrenado desde cero** (sin pesos de ning煤n modelo previo) y afinado para conversar.
|
| 18 |
-
Su asistente se llama **Milo**.
|
| 19 |
-
|
| 20 |
-
- Contexto: 1024 tokens 路 Vocabulario: 12288 (BPE byte-level propio) 路 Idiomas: espa帽ol e ingl茅s
|
| 21 |
-
- Formato de chat: `<|system|>`, `<|user|>`, `<|assistant|>` terminados en `<|end|>` (ya incluido como `chat_template`)
|
| 22 |
-
|
| 23 |
-
## Uso
|
| 24 |
-
|
| 25 |
-
```python
|
| 26 |
-
import torch
|
| 27 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 28 |
-
|
| 29 |
-
repo = "TU_USUARIO/MiloX"
|
| 30 |
-
device = "cuda" if torch.cuda.is_available() else "cpu"
|
| 31 |
-
tok = AutoTokenizer.from_pretrained(repo)
|
| 32 |
-
model = AutoModelForCausalLM.from_pretrained(repo).to(device).eval()
|
| 33 |
-
|
| 34 |
-
msgs = [{"role": "user", "content": "Hola, 驴qui茅n eres?"}]
|
| 35 |
-
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
|
| 36 |
-
inputs = tok(text, return_tensors="pt", add_special_tokens=False).to(device)
|
| 37 |
-
out = model.generate(**inputs, max_new_tokens=200, do_sample=True, temperature=0.5,
|
| 38 |
-
top_p=0.9, top_k=30)
|
| 39 |
-
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
|
| 40 |
-
```
|
| 41 |
-
|
| 42 |
-
## Limitaciones
|
| 43 |
-
Es un modelo peque帽o: puede equivocarse, inventar datos o repetirse. No lo uses para decisiones importantes.
|
| 44 |
-
Revisa las licencias de los datasets usados en el preentrenamiento y el fine-tuning antes de elegir la licencia final del repo.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|