Instructions to use EditorZ/GuidoGPT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use EditorZ/GuidoGPT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="EditorZ/GuidoGPT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("EditorZ/GuidoGPT") model = AutoModelForCausalLM.from_pretrained("EditorZ/GuidoGPT", device_map="auto") 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use EditorZ/GuidoGPT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "EditorZ/GuidoGPT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "EditorZ/GuidoGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/EditorZ/GuidoGPT
- SGLang
How to use EditorZ/GuidoGPT 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 "EditorZ/GuidoGPT" \ --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": "EditorZ/GuidoGPT", "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 "EditorZ/GuidoGPT" \ --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": "EditorZ/GuidoGPT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use EditorZ/GuidoGPT with Docker Model Runner:
docker model run hf.co/EditorZ/GuidoGPT
|
Download README.md from EditorZ/GuidoGPT: direct link, hf CLI and curl.
- Browser
- Download file 1.55 kB
-
https://huggingface.co/EditorZ/GuidoGPT/resolve/main/README.md
- Command line
-
hf download hf://EditorZ/GuidoGPT/README.md
-
curl -L -o README.md https://huggingface.co/EditorZ/GuidoGPT/resolve/main/README.md
1.55 kB
| library_name: transformers | |
| license: llama3 | |
| datasets: | |
| - aqua_rat | |
| - microsoft/orca-math-word-problems-200k | |
| - m-a-p/CodeFeedback-Filtered-Instruction | |
| # Guido-Llama-3-70B-Instruct-32K | |
| ### Built with Meta Llama 3 | |
| This is a 32K version of Llama-3-70B-Instruct. | |
| More details are coming soon. | |
| ### Model Description | |
| - **Developed by:** [Guido AI](https://guido-marsch.com) | |
| - **License:** https://llama.meta.com/llama3/license/ | |
| - **Finetuned from model:** [meta-llama/Meta-Llama-3-70B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3-70B-Instruct). | |
| ## How to use | |
| The prompt format is unchanged from Llama 3 70B Instruct. | |
| ### Use with transformers | |
| See the snippet below for usage with Transformers: | |
| ```python | |
| import transformers | |
| import torch | |
| model_id = "EditorZ/Guido-Llama-3-70B-Instruct" | |
| pipeline = transformers.pipeline( | |
| "text-generation", | |
| model=model_id, | |
| model_kwargs={"torch_dtype": torch.bfloat16}, | |
| device_map="auto", | |
| ) | |
| messages = [ | |
| {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"}, | |
| {"role": "user", "content": "Who are you?"}, | |
| ] | |
| prompt = pipeline.tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True | |
| ) | |
| terminators = [ | |
| pipeline.tokenizer.eos_token_id, | |
| pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>") | |
| ] | |
| outputs = pipeline( | |
| prompt, | |
| max_new_tokens=256, | |
| eos_token_id=terminators, | |
| do_sample=True, | |
| temperature=0.6, | |
| top_p=0.9, | |
| ) | |
| print(outputs[0]["generated_text"][len(prompt):]) | |
| ``` |