Instructions to use Nan-Do/python-assistant-3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Nan-Do/python-assistant-3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Nan-Do/python-assistant-3b")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Nan-Do/python-assistant-3b") model = AutoModelForCausalLM.from_pretrained("Nan-Do/python-assistant-3b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Nan-Do/python-assistant-3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Nan-Do/python-assistant-3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Nan-Do/python-assistant-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Nan-Do/python-assistant-3b
- SGLang
How to use Nan-Do/python-assistant-3b 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 "Nan-Do/python-assistant-3b" \ --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": "Nan-Do/python-assistant-3b", "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 "Nan-Do/python-assistant-3b" \ --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": "Nan-Do/python-assistant-3b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Nan-Do/python-assistant-3b with Docker Model Runner:
docker model run hf.co/Nan-Do/python-assistant-3b
Commit History
-
Updated the description
142f9cd
-
Update README.md
66a03c2 -
Updated the Readme for Version 2.0
f8f0895 -
Upload LlamaForCausalLM
b41722f
-
Update README.md
Updated description2016b6b -
Update README.md
Fixed a typo.88e9743 -
Update README.md
Updated formatingf492d73 -
Update README.md
Updated descriptionc842d52 -
Update README.md
Fixed a typo.4b93c30 -
Update README.md
26d4396 -
Update README.md
96fec52 -
Update README.md
Updated descriptiond8f5c05 -
Update README.md
Fixed grammar675ef5c -
Upload LlamaForCausalLM
759827b -
Update README.md
Updated formatting and added a TLDR;206b5d8 -
Update README.md
611d796
-
Update README.md
Updated formatting.b58ec89
-
Fixed a typo.
aa7ffc9 -
Update README.md
Updated the training method5c362d8 -
Updated formating.
c5be8a5 -
Added information about the prompt
4a044e0 -
Fixed some typos.
b7f2f07 -
Update README.md
f6cc6f2 -
Updated formating
4e74f0c -
Updated the formating.
e739fd0 -
Added a description including the model's capabilities
debbbde
-
Create README.md
This is proof of concept of what LLM's are able to do when fine-tuned for code generation and understanding. The base model is based on OpenLlama-3b and can be found [here](https://huggingface.co/psmathur/orca_mini_3b) and trained using [axolotl](https://github.com/OpenAccess-AI-Collective/axolotl/tree/main) Next I'll show some examples of what the model is currently capable of. I have edited the quotes to be able to show the prompts correctly here the model writes proper markdown. The first sample shows a non-trivial example of the model generating code. (Depending on the complexity of the required task the generated code might not work. For example, making the model write code to move the square around has proven to be quite difficult.) ``` Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Write Python code to draw a square on the screen using Pygame. ### Response: Sure, here's a Python code to draw a …7b851dd
-
Upload LlamaForCausalLM
2580afd -
Upload tokenizer
c06ddb9 -
initial commit
bc6e018