Instructions to use alibidaran/LLAMA3-Reasoning_Python with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use alibidaran/LLAMA3-Reasoning_Python with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="alibidaran/LLAMA3-Reasoning_Python")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("alibidaran/LLAMA3-Reasoning_Python") model = AutoModelForCausalLM.from_pretrained("alibidaran/LLAMA3-Reasoning_Python", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use alibidaran/LLAMA3-Reasoning_Python with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "alibidaran/LLAMA3-Reasoning_Python" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "alibidaran/LLAMA3-Reasoning_Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/alibidaran/LLAMA3-Reasoning_Python
- SGLang
How to use alibidaran/LLAMA3-Reasoning_Python 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 "alibidaran/LLAMA3-Reasoning_Python" \ --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": "alibidaran/LLAMA3-Reasoning_Python", "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 "alibidaran/LLAMA3-Reasoning_Python" \ --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": "alibidaran/LLAMA3-Reasoning_Python", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Unsloth Desktop
- Docker Model Runner
How to use alibidaran/LLAMA3-Reasoning_Python with Docker Model Runner:
docker model run hf.co/alibidaran/LLAMA3-Reasoning_Python
|
Download README.md from alibidaran/LLAMA3-Reasoning_Python: direct link, hf CLI and curl.
- Browser
- Download file 1.65 kB
-
https://huggingface.co/alibidaran/LLAMA3-Reasoning_Python/resolve/refs%2Fpr%2F1/README.md
- Command line
-
hf download hf://alibidaran/LLAMA3-Reasoning_Python@refs/pr/1/README.md
-
curl -L -o README.md https://huggingface.co/alibidaran/LLAMA3-Reasoning_Python/resolve/refs%2Fpr%2F1/README.md
1.65 kB
| library_name: transformers | |
| tags: | |
| - unsloth | |
| - trl | |
| - sft | |
| license: mit | |
| datasets: | |
| - nvidia/OpenCodeReasoning | |
| language: | |
| - en | |
| base_model: | |
| - unsloth/Meta-Llama-3.1-8B | |
| ### Direct Use | |
| ```python | |
| from unsloth import FastLanguageModel | |
| from transformers import ( | |
| pipeline, | |
| logging, | |
| ) | |
| FastLanguageModel.for_inference(model) # Enable native 2x faster inference | |
| logging.set_verbosity(logging.CRITICAL) | |
| # Run text generation pipeline with our next model | |
| prompt=""" | |
| You are expert python programmer. You need to write a function based on the given <description> | |
| <description> | |
| You are given a sequence of positive integers a1, a2, ..., an. Find all such indices i, that the i-th element equals the arithmetic mean of all other elements (that is all elements except for this one).\nInput\n\nThe first line contains the integer n (2 ≤ n ≤ 2·105). The second line contains elements of the sequence a1, a2, ..., an (1 ≤ ai ≤ 1000). All the elements are positive integers.\n\nOutput\n\nPrint on the first line the number of the sought indices. Print on the second line the sought indices in the increasing order. All indices are integers from 1 to n.\n\nIf the sought elements do not exist, then the first output line should contain number 0. In this case you may either not print the second line or print an empty line.\n\nExamples\n\nInput\n\n5\n1 2 3 4 5\n\n\nOutput\n\n1\n3 \n\nInput\n\n4\n50 50 50 50\n\n\nOutput\n\n4\n1 2 3 4</description> | |
| <output> | |
| """ | |
| pipe = pipeline(task="text-generation", model=model, tokenizer=tokenizer, max_length=3000,do_sample=True,top_k=10,top_p=0.9) | |
| result = pipe(prompt) | |
| print(result[0]['generated_text']) | |