Instructions to use PartAI/Dorna-Llama3-8B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PartAI/Dorna-Llama3-8B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PartAI/Dorna-Llama3-8B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("PartAI/Dorna-Llama3-8B-Instruct") model = AutoModelForCausalLM.from_pretrained("PartAI/Dorna-Llama3-8B-Instruct") 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 Settings
- vLLM
How to use PartAI/Dorna-Llama3-8B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PartAI/Dorna-Llama3-8B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PartAI/Dorna-Llama3-8B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/PartAI/Dorna-Llama3-8B-Instruct
- SGLang
How to use PartAI/Dorna-Llama3-8B-Instruct 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 "PartAI/Dorna-Llama3-8B-Instruct" \ --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": "PartAI/Dorna-Llama3-8B-Instruct", "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 "PartAI/Dorna-Llama3-8B-Instruct" \ --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": "PartAI/Dorna-Llama3-8B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use PartAI/Dorna-Llama3-8B-Instruct with Docker Model Runner:
docker model run hf.co/PartAI/Dorna-Llama3-8B-Instruct
ارور در اجرای مدل
وقتی میخوام از مدل استفاده بکنم با این ارور مواجه شدم.
OSError: We couldn't connect to 'https://huggingface.co' to load this file, couldn't find it in the cached files and it looks like PartAI/Dorna-Llama3-8B-Instruct is not the path to a directory containing a file named config.json.
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'.
با وجود این که توکن رو هم تعریف کردم با این ارور روبرو میشم.
سلام من هم توکن رو در huggingface ساختم ولی هنوز ارور احراز هویت میده
سلام . من هم همین اررور رو میگیرم
کدی که اجرا میکنید را ممنون میشوم بفرستید. همچنین ورژن دقیق کتابخانه های اصلی مورد استفاده را هم بفرمایید.
با سلامکدی که اجرا میکنید را ممنون میشوم بفرستید. همچنین ورژن دقیق کتابخانه های اصلی مورد استفاده را هم بفرمایید.
سلام
من همون فایل کولبی که روی model card قرار داره اجرا میکنم.
توکن خودم رو جایگذاری میکنم و اجرا میکنم
به این لینک:
https://colab.research.google.com/drive/1TmeZsN4Byi1EgAEQeOt27sPrZOWn5gBH?usp=sharing
البته من مشکل رو متوجه شدم. زمانی که توکنی که دریافت میکنم، روی حالت write باشه مشکلی پیش نمیاد و مدل اجرا میشه.
بسیار عالی
موفق باشید.