Instructions to use adowu/astral-128k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use adowu/astral-128k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="adowu/astral-128k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("adowu/astral-128k") model = AutoModelForCausalLM.from_pretrained("adowu/astral-128k") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use adowu/astral-128k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "adowu/astral-128k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "adowu/astral-128k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/adowu/astral-128k
- SGLang
How to use adowu/astral-128k 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 "adowu/astral-128k" \ --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": "adowu/astral-128k", "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 "adowu/astral-128k" \ --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": "adowu/astral-128k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use adowu/astral-128k with Docker Model Runner:
docker model run hf.co/adowu/astral-128k
ASTRAL-128K
Model Description
The adowu/astral-128k model is a state-of-the-art language model based on the MistralForCausalLM architecture, designed for causal text generation. This means the model generates text sequentially, where each subsequent word is chosen based on the previous words in the sequence. Below is an overview of the key features and configuration of this model.
Architectural Highlights
The model is built on a foundation designed to understand and generate language by sequentially predicting the next piece of text based on the preceding context. Its architecture allows for deep understanding of language nuances, enabling the generation of text that is not only relevant but also rich in variety.
Capabilities
With its advanced architecture, the model can handle a wide range of language generation tasks. It is capable of generating long passages of text that maintain coherence and relevance throughout, making it suitable for tasks such as content creation, conversation generation, and more complex applications like summarization and translation in context-rich scenarios.
Performance and Efficiency
The model is optimized for both performance and efficiency, ensuring that it can process and generate text quickly while maintaining a high level of accuracy and coherence in the output. This balance makes it an excellent tool for developers and researchers looking for a reliable model for generating high-quality text.
Application Scope
Due to its versatile nature, the model finds applications across various domains, including but not limited to, automated storytelling, chatbots, and assistance systems, content generation for websites, and aiding in the creation of written content for educational and informational purposes.
In summary, the adowu/astral-128k model represents a significant advancement in the field of natural language processing, offering a powerful tool for generating human-like text across a wide array of applications.
- Developed by: aww
- Model type: Mistral
- Downloads last month
- 12