Text Generation
Transformers
PyTorch
Spanish
llama
4bit
lora
Eval Results (legacy)
text-generation-inference
Instructions to use Xelta/miniXelta_01 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Xelta/miniXelta_01 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Xelta/miniXelta_01")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Xelta/miniXelta_01") model = AutoModelForCausalLM.from_pretrained("Xelta/miniXelta_01") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Xelta/miniXelta_01 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Xelta/miniXelta_01" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xelta/miniXelta_01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Xelta/miniXelta_01
- SGLang
How to use Xelta/miniXelta_01 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 "Xelta/miniXelta_01" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xelta/miniXelta_01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Xelta/miniXelta_01" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Xelta/miniXelta_01", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Xelta/miniXelta_01 with Docker Model Runner:
docker model run hf.co/Xelta/miniXelta_01
Upload README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: es
|
| 3 |
+
datasets:
|
| 4 |
+
- Xelta/response_mongo_text
|
| 5 |
+
metrics:
|
| 6 |
+
- accuracy
|
| 7 |
+
tags:
|
| 8 |
+
- llama
|
| 9 |
+
- 4bit
|
| 10 |
+
- lora
|
| 11 |
+
model-index:
|
| 12 |
+
- name: llama-2-7b-miniXelta
|
| 13 |
+
results:
|
| 14 |
+
- task:
|
| 15 |
+
type: text-generation
|
| 16 |
+
name: Text Generation
|
| 17 |
+
dataset:
|
| 18 |
+
name: response_mongo_text
|
| 19 |
+
type: Xelta/response_mongo_text
|
| 20 |
+
metrics:
|
| 21 |
+
- name: Accuracy
|
| 22 |
+
type: accuracy
|
| 23 |
+
value: 0.95 # Si tienes este dato
|
| 24 |
+
---
|
| 25 |
|
| 26 |
+
# Llama-2-7b-miniXelta
|
| 27 |
+
|
| 28 |
+
Este es un modelo ajustado a partir del modelo Llama-2-7b-chat-hf utilizando LoRA y precisi贸n de 4 bits. Ha sido entrenado con el conjunto de datos `Xelta/response_mongo_text`.
|
| 29 |
+
|
| 30 |
+
## Uso
|
| 31 |
+
|
| 32 |
+
Puedes usar este modelo para generaci贸n de texto de la siguiente manera:
|
| 33 |
+
|
| 34 |
+
```python
|
| 35 |
+
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 36 |
+
|
| 37 |
+
model_name = "username/llama-2-7b-miniXelta"
|
| 38 |
+
|
| 39 |
+
model = AutoModelForCausalLM.from_pretrained(model_name)
|
| 40 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
| 41 |
+
|
| 42 |
+
prompt = "Quiero inscribirme, soy Mattias y mi edad es 28 a帽os"
|
| 43 |
+
inputs = tokenizer(prompt, return_tensors="pt")
|
| 44 |
+
outputs = model.generate(**inputs)
|
| 45 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|