sudy-super/JetCopper-10B
Viewer • Updated • 15.9M • 70 • 5
How to use sudy-super/Contrail-200m-64k with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="sudy-super/Contrail-200m-64k") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sudy-super/Contrail-200m-64k")
model = AutoModelForCausalLM.from_pretrained("sudy-super/Contrail-200m-64k")How to use sudy-super/Contrail-200m-64k with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "sudy-super/Contrail-200m-64k"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "sudy-super/Contrail-200m-64k",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/sudy-super/Contrail-200m-64k
How to use sudy-super/Contrail-200m-64k with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "sudy-super/Contrail-200m-64k" \
--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": "sudy-super/Contrail-200m-64k",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "sudy-super/Contrail-200m-64k" \
--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": "sudy-super/Contrail-200m-64k",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use sudy-super/Contrail-200m-64k with Docker Model Runner:
docker model run hf.co/sudy-super/Contrail-200m-64k
Logo designed by Rotejin.
Contrail is Mistral model pre-trained on the 10b tokens of JetCopper-10B.
A final validation perplexity of 27.88 has been reached.
Architecture: Mistral (LLaMA-compatible)
Model size: 200M
Trained tokens: 10B tokens
Context length: 65536
Languages: Japanese, English
License: Apache-2.0
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
import torch
model_name = "sudy-super/Contrail-200m-64k"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto", torch_dtype=torch.bfloat16)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
if torch.cuda.is_available():
model = model.to("cuda")
prompt = "AIによって私達の暮らしは、"
with torch.no_grad():
token_ids = tokenizer.encode(prompt, return_tensors="pt")
output_ids = model.generate(
input_ids=token_ids.to(model.device),
min_new_tokens=10,
max_new_tokens=100,
do_sample=True,
temperature=0.7,
streamer=streamer,
)
@article{jiang2023mistral},
title={Mistral 7B},
author={Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, L{\'e}lio Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timoth{\'e}e Lacroix, William El Sayed},
journal={arXiv preprint arXiv:2310.06825},
year={2023}
}