Text Generation
Transformers
Safetensors
English
llama
llama-3
astronomy
astrophysics
arxiv
text-generation-inference
Instructions to use AstroMLab/astrollama-3-8b-base_aic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AstroMLab/astrollama-3-8b-base_aic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AstroMLab/astrollama-3-8b-base_aic")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("AstroMLab/astrollama-3-8b-base_aic") model = AutoModelForCausalLM.from_pretrained("AstroMLab/astrollama-3-8b-base_aic", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AstroMLab/astrollama-3-8b-base_aic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AstroMLab/astrollama-3-8b-base_aic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AstroMLab/astrollama-3-8b-base_aic", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/AstroMLab/astrollama-3-8b-base_aic
- SGLang
How to use AstroMLab/astrollama-3-8b-base_aic 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 "AstroMLab/astrollama-3-8b-base_aic" \ --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": "AstroMLab/astrollama-3-8b-base_aic", "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 "AstroMLab/astrollama-3-8b-base_aic" \ --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": "AstroMLab/astrollama-3-8b-base_aic", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use AstroMLab/astrollama-3-8b-base_aic with Docker Model Runner:
docker model run hf.co/AstroMLab/astrollama-3-8b-base_aic
Update README.md
Browse files
README.md
CHANGED
|
@@ -33,7 +33,7 @@ AstroLLaMA-3-8B is a specialized base language model for astronomy, developed by
|
|
| 33 |
- Cosine decay schedule for learning rate reduction
|
| 34 |
- Training duration: 1 epoch
|
| 35 |
- **Primary Use**: Next token prediction for astronomy-related text generation and analysis
|
| 36 |
-
- **Reference**: Pan et al. 2024
|
| 37 |
|
| 38 |
## Generating text from a prompt
|
| 39 |
|
|
@@ -73,10 +73,11 @@ print(generated_text[0]['generated_text'])
|
|
| 73 |
|
| 74 |
A key limitation identified during the development of this model is that training solely on astro-ph data may not be sufficient to significantly improve performance over the base model, especially for the already highly performant LLaMA-3 series. This suggests that to achieve substantial gains, future iterations may need to incorporate a broader range of high-quality astronomical data beyond arXiv, such as textbooks, Wikipedia, and curated summaries.
|
| 75 |
|
| 76 |
-
Here's a performance comparison chart based upon the astronomical benchmarking Q&A as described in [Ting et al. 2024](https://arxiv.org/abs/2407.11194)
|
| 77 |
|
| 78 |
| Model | Score (%) |
|
| 79 |
|-------|-----------|
|
|
|
|
| 80 |
| LLaMA-3.1-8B | 73.7 |
|
| 81 |
| LLaMA-3-8B | 72.9 |
|
| 82 |
| **<span style="color:green">AstroLLaMA-3-8B-Base_AIC (AstroMLab)</span>** | **<span style="color:green">71.9</span>** |
|
|
|
|
| 33 |
- Cosine decay schedule for learning rate reduction
|
| 34 |
- Training duration: 1 epoch
|
| 35 |
- **Primary Use**: Next token prediction for astronomy-related text generation and analysis
|
| 36 |
+
- **Reference**: [Pan et al. 2024](https://arxiv.org/abs/2409.19750)
|
| 37 |
|
| 38 |
## Generating text from a prompt
|
| 39 |
|
|
|
|
| 73 |
|
| 74 |
A key limitation identified during the development of this model is that training solely on astro-ph data may not be sufficient to significantly improve performance over the base model, especially for the already highly performant LLaMA-3 series. This suggests that to achieve substantial gains, future iterations may need to incorporate a broader range of high-quality astronomical data beyond arXiv, such as textbooks, Wikipedia, and curated summaries.
|
| 75 |
|
| 76 |
+
Here's a performance comparison chart based upon the astronomical benchmarking Q&A as described in [Ting et al. 2024](https://arxiv.org/abs/2407.11194):
|
| 77 |
|
| 78 |
| Model | Score (%) |
|
| 79 |
|-------|-----------|
|
| 80 |
+
| **AstroSage-LLaMA-3.1-8B (AstroMLab)** | **80.9** |
|
| 81 |
| LLaMA-3.1-8B | 73.7 |
|
| 82 |
| LLaMA-3-8B | 72.9 |
|
| 83 |
| **<span style="color:green">AstroLLaMA-3-8B-Base_AIC (AstroMLab)</span>** | **<span style="color:green">71.9</span>** |
|