Text Generation
Transformers
TensorBoard
Safetensors
PEFT
Trained with AutoTrain
text-generation-inference
conversational
Instructions to use yd915/AstroBot1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yd915/AstroBot1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yd915/AstroBot1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("yd915/AstroBot1", device_map="auto") - PEFT
How to use yd915/AstroBot1 with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use yd915/AstroBot1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yd915/AstroBot1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yd915/AstroBot1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yd915/AstroBot1
- SGLang
How to use yd915/AstroBot1 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 "yd915/AstroBot1" \ --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": "yd915/AstroBot1", "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 "yd915/AstroBot1" \ --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": "yd915/AstroBot1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yd915/AstroBot1 with Docker Model Runner:
docker model run hf.co/yd915/AstroBot1
Upload folder using huggingface_hub
Browse filesFiles changed (11)
- README.mdAdded+46
- adapter_config.jsonAdded+34
- adapter_model.safetensorsAdded+3
- merges.txtAdded
- runs/Jul24_02-20-19_r-yd915-bigcomp-6bczvtfr-7aefd-ox5om/events.out.tfevents.1721787752.r-yd915-bigcomp-6bczvtfr-7aefd-ox5om.79.0+2-2
- special_tokens_map.jsonAdded+43
- tokenizer.jsonAdded
- tokenizer_config.jsonAdded+169
- training_args.binAdded+3
- training_params.jsonAdded+48
- vocab.jsonAdded
12345678910111213141516171819202122232425262728293031323334353637383940414243444546---tags:- autotrain- text-generation-inference- text-generation- peftlibrary_name: transformersbase_model: HuggingFaceTB/SmolLM-1.7Bwidget: - messages: - role: user content: What is your favorite condiment?license: other---
# Model Trained Using AutoTrain
This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
# Usage
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = "PATH_TO_THIS_REPO"
tokenizer = AutoTokenizer.from_pretrained(model_path)model = AutoModelForCausalLM.from_pretrained( model_path, device_map="auto", torch_dtype='auto').eval()
# Prompt content: "hi"messages = [ {"role": "user", "content": "hi"}]
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')output_ids = model.generate(input_ids.to('cuda'))response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
# Model response: "Hello! How can I assist you today?"print(response)```12345678910111213141516171819202122232425262728293031323334{ "alpha_pattern": {}, "auto_mapping": null, "base_model_name_or_path": "HuggingFaceTB/SmolLM-1.7B", "bias": "none", "fan_in_fan_out": false, "inference_mode": true, "init_lora_weights": true, "layer_replication": null, "layers_pattern": null, "layers_to_transform": null, "loftq_config": {}, "lora_alpha": 32, "lora_dropout": 0.05, "megatron_config": null, "megatron_core": "megatron.core", "modules_to_save": null, "peft_type": "LORA", "r": 16, "rank_pattern": {}, "revision": null, "target_modules": [ "o_proj", "q_proj", "v_proj", "up_proj", "k_proj", "gate_proj", "down_proj" ], "task_type": "CAUSAL_LM", "use_dora": false, "use_rslora": false}123version https://git-lfs.github.com/spec/v1oid sha256:9e0973eeacee9efa605b1d043f943a7c38090e3f66d5b13e9c2de1b2cc290430size 7239637612323version https://git-lfs.github.com/spec/v1oid sha256:9be3d41dc8e0da3516f062cea78b83f83e28ac681e1a877092827d2a6e0aab8bsize 15181oid sha256:6c50a310788444ded35ee5bfcc13223ce283075b1f2ecf1470debb9db0a005a6size 1725512345678910111213141516171819202122232425262728293031323334353637383940414243{ "additional_special_tokens": [ "<|endoftext|>", "<|im_start|>", "<|im_end|>", "<repo_name>", "<reponame>", "<file_sep>", "<filename>", "<gh_stars>", "<issue_start>", "<issue_comment>", "<issue_closed>", "<jupyter_start>", "<jupyter_text>", "<jupyter_code>", "<jupyter_output>", "<jupyter_script>", "<empty_output>" ], "bos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }, "pad_token": "<|endoftext|>", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false }}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169{ "add_prefix_space": false, "added_tokens_decoder": { "0": { "content": "<|endoftext|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "1": { "content": "<|im_start|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "2": { "content": "<|im_end|>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "3": { "content": "<repo_name>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "4": { "content": "<reponame>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "5": { "content": "<file_sep>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "6": { "content": "<filename>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "7": { "content": "<gh_stars>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "8": { "content": "<issue_start>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "9": { "content": "<issue_comment>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "10": { "content": "<issue_closed>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "11": { "content": "<jupyter_start>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "12": { "content": "<jupyter_text>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "13": { "content": "<jupyter_code>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "14": { "content": "<jupyter_output>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "15": { "content": "<jupyter_script>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true }, "16": { "content": "<empty_output>", "lstrip": false, "normalized": false, "rstrip": false, "single_word": false, "special": true } }, "additional_special_tokens": [ "<|endoftext|>", "<|im_start|>", "<|im_end|>", "<repo_name>", "<reponame>", "<file_sep>", "<filename>", "<gh_stars>", "<issue_start>", "<issue_comment>", "<issue_closed>", "<jupyter_start>", "<jupyter_text>", "<jupyter_code>", "<jupyter_output>", "<jupyter_script>", "<empty_output>" ], "bos_token": "<|endoftext|>", "chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}", "clean_up_tokenization_spaces": false, "eos_token": "<|endoftext|>", "model_max_length": 2048, "pad_token": "<|endoftext|>", "tokenizer_class": "GPT2Tokenizer", "unk_token": "<|endoftext|>", "vocab_size": 49152}123version https://git-lfs.github.com/spec/v1oid sha256:6f474e7fd5a9303772b30645a19217cf50ceb5f2f44fd9cdf97c949b5d83a95esize 5496123456789101112131415161718192021222324252627282930313233343536373839404142434445464748{ "model": "HuggingFaceTB/SmolLM-1.7B", "project_name": "AstroBot1", "data_path": "AstroBot1/autotrain-data", "train_split": "train", "valid_split": null, "add_eos_token": true, "block_size": 1024, "model_max_length": 2048, "padding": "right", "trainer": "orpo", "use_flash_attention_2": false, "log": "tensorboard", "disable_gradient_checkpointing": false, "logging_steps": -1, "eval_strategy": "epoch", "save_total_limit": 1, "auto_find_batch_size": false, "mixed_precision": "fp16", "lr": 3e-05, "epochs": 3, "batch_size": 2, "warmup_ratio": 0.1, "gradient_accumulation": 4, "optimizer": "adamw_torch", "scheduler": "linear", "weight_decay": 0.0, "max_grad_norm": 1.0, "seed": 42, "chat_template": "none", "quantization": "int4", "target_modules": "all-linear", "merge_adapter": false, "peft": true, "lora_r": 16, "lora_alpha": 32, "lora_dropout": 0.05, "model_ref": null, "dpo_beta": 0.1, "max_prompt_length": 128, "max_completion_length": null, "prompt_text_column": "autotrain_prompt", "text_column": "autotrain_text", "rejected_text_column": "autotrain_rejected_text", "push_to_hub": true, "username": "yd915", "unsloth": false}README.mdAdded+46
adapter_config.jsonAdded+34
adapter_model.safetensorsAdded+3
merges.txtAdded
runs/Jul24_02-20-19_r-yd915-bigcomp-6bczvtfr-7aefd-ox5om/events.out.tfevents.1721787752.r-yd915-bigcomp-6bczvtfr-7aefd-ox5om.79.0+2-2
special_tokens_map.jsonAdded+43
tokenizer.jsonAdded
tokenizer_config.jsonAdded+169
training_args.binAdded+3
training_params.jsonAdded+48
vocab.jsonAdded