Instructions to use CloveAI/LlamaWeb with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use CloveAI/LlamaWeb with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit") model = PeftModel.from_pretrained(base_model, "CloveAI/LlamaWeb") - Transformers
How to use CloveAI/LlamaWeb with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="CloveAI/LlamaWeb") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("CloveAI/LlamaWeb", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use CloveAI/LlamaWeb with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "CloveAI/LlamaWeb" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "CloveAI/LlamaWeb", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/CloveAI/LlamaWeb
- SGLang
How to use CloveAI/LlamaWeb 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 "CloveAI/LlamaWeb" \ --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": "CloveAI/LlamaWeb", "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 "CloveAI/LlamaWeb" \ --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": "CloveAI/LlamaWeb", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Unsloth Studio
How to use CloveAI/LlamaWeb with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CloveAI/LlamaWeb to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for CloveAI/LlamaWeb to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for CloveAI/LlamaWeb to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="CloveAI/LlamaWeb", max_seq_length=2048, ) - Docker Model Runner
How to use CloveAI/LlamaWeb with Docker Model Runner:
docker model run hf.co/CloveAI/LlamaWeb
Alan Joshua commited on
Upload folder using huggingface_hub
Browse files- README.md +2 -48
- adapter_config.json +5 -5
- adapter_model.safetensors +2 -2
- tokenizer_config.json +1 -1
- training_args.bin +1 -1
README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
---
|
| 2 |
-
base_model: unsloth/llama-3.2-
|
| 3 |
library_name: peft
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
-
- base_model:adapter:unsloth/llama-3.2-
|
| 7 |
- lora
|
| 8 |
- sft
|
| 9 |
- transformers
|
|
@@ -11,52 +11,6 @@ tags:
|
|
| 11 |
- unsloth
|
| 12 |
---
|
| 13 |
|
| 14 |
-
```python
|
| 15 |
-
import torch
|
| 16 |
-
from unsloth import FastLanguageModel
|
| 17 |
-
|
| 18 |
-
# Load your LoRA fine-tuned model
|
| 19 |
-
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 20 |
-
model_name = "alanjoshua2005/LlamaWeb", # path to your fine-tuned model
|
| 21 |
-
max_seq_length = 2048,
|
| 22 |
-
dtype = None, # Auto-detect precision
|
| 23 |
-
load_in_4bit = True, # or False if you're on CPU
|
| 24 |
-
)
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
#test_prompt = "Create a modern hero section for a travel booking website using Tailwind CSS."
|
| 28 |
-
test_prompt = """You are an expert Tailwind CSS web designer.
|
| 29 |
-
Generate a **complete stunning HTML5 landing page** wrapped in <html>, <head>, and <body> tags.
|
| 30 |
-
Do NOT stop until the full closing </html> tag is produced.
|
| 31 |
-
|
| 32 |
-
Title: "Amazing Places to Visit"
|
| 33 |
-
Requirements:
|
| 34 |
-
- Include navigation bar, hero section, features section, pricing section, and footer.
|
| 35 |
-
- Use TailwindCSS via CDN.
|
| 36 |
-
- Use modern, responsive design and aesthetic color schemes.
|
| 37 |
-
|
| 38 |
-
Output only the HTML code, nothing else."""
|
| 39 |
-
|
| 40 |
-
inputs = tokenizer(test_prompt, return_tensors="pt").to(model.device)
|
| 41 |
-
|
| 42 |
-
# Generate
|
| 43 |
-
with torch.no_grad():
|
| 44 |
-
outputs = model.generate(
|
| 45 |
-
**inputs,
|
| 46 |
-
max_new_tokens=2000,
|
| 47 |
-
temperature=0.6,
|
| 48 |
-
top_p=0.9,
|
| 49 |
-
do_sample=True,
|
| 50 |
-
repetition_penalty=1.15,
|
| 51 |
-
eos_token_id=tokenizer.eos_token_id,
|
| 52 |
-
)
|
| 53 |
-
|
| 54 |
-
# Decode output
|
| 55 |
-
generated_html = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 56 |
-
print(generated_html)
|
| 57 |
-
|
| 58 |
-
```
|
| 59 |
-
|
| 60 |
# Model Card for Model ID
|
| 61 |
|
| 62 |
<!-- Provide a quick summary of what the model is/does. -->
|
|
|
|
| 1 |
---
|
| 2 |
+
base_model: unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit
|
| 3 |
library_name: peft
|
| 4 |
pipeline_tag: text-generation
|
| 5 |
tags:
|
| 6 |
+
- base_model:adapter:unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit
|
| 7 |
- lora
|
| 8 |
- sft
|
| 9 |
- transformers
|
|
|
|
| 11 |
- unsloth
|
| 12 |
---
|
| 13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
# Model Card for Model ID
|
| 15 |
|
| 16 |
<!-- Provide a quick summary of what the model is/does. -->
|
adapter_config.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
"parent_library": "transformers.models.llama.modeling_llama",
|
| 6 |
"unsloth_fixed": true
|
| 7 |
},
|
| 8 |
-
"base_model_name_or_path": "unsloth/llama-3.2-
|
| 9 |
"bias": "none",
|
| 10 |
"corda_config": null,
|
| 11 |
"eva_config": null,
|
|
@@ -29,13 +29,13 @@
|
|
| 29 |
"rank_pattern": {},
|
| 30 |
"revision": null,
|
| 31 |
"target_modules": [
|
| 32 |
-
"gate_proj",
|
| 33 |
-
"v_proj",
|
| 34 |
"o_proj",
|
|
|
|
|
|
|
| 35 |
"up_proj",
|
|
|
|
| 36 |
"k_proj",
|
| 37 |
-
"
|
| 38 |
-
"q_proj"
|
| 39 |
],
|
| 40 |
"target_parameters": null,
|
| 41 |
"task_type": "CAUSAL_LM",
|
|
|
|
| 5 |
"parent_library": "transformers.models.llama.modeling_llama",
|
| 6 |
"unsloth_fixed": true
|
| 7 |
},
|
| 8 |
+
"base_model_name_or_path": "unsloth/llama-3.2-3b-instruct-unsloth-bnb-4bit",
|
| 9 |
"bias": "none",
|
| 10 |
"corda_config": null,
|
| 11 |
"eva_config": null,
|
|
|
|
| 29 |
"rank_pattern": {},
|
| 30 |
"revision": null,
|
| 31 |
"target_modules": [
|
|
|
|
|
|
|
| 32 |
"o_proj",
|
| 33 |
+
"down_proj",
|
| 34 |
+
"q_proj",
|
| 35 |
"up_proj",
|
| 36 |
+
"gate_proj",
|
| 37 |
"k_proj",
|
| 38 |
+
"v_proj"
|
|
|
|
| 39 |
],
|
| 40 |
"target_parameters": null,
|
| 41 |
"task_type": "CAUSAL_LM",
|
adapter_model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:88ea72cf5ae98dfd7506a596599bb0961e844df66a0f4097497716b34f0ff8e7
|
| 3 |
+
size 97307544
|
tokenizer_config.json
CHANGED
|
@@ -2060,7 +2060,7 @@
|
|
| 2060 |
],
|
| 2061 |
"model_max_length": 131072,
|
| 2062 |
"pad_token": "<|finetune_right_pad_id|>",
|
| 2063 |
-
"padding_side": "
|
| 2064 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 2065 |
"unk_token": null
|
| 2066 |
}
|
|
|
|
| 2060 |
],
|
| 2061 |
"model_max_length": 131072,
|
| 2062 |
"pad_token": "<|finetune_right_pad_id|>",
|
| 2063 |
+
"padding_side": "left",
|
| 2064 |
"tokenizer_class": "PreTrainedTokenizerFast",
|
| 2065 |
"unk_token": null
|
| 2066 |
}
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 6289
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8c77f48404575c98b26c8b3ee04032fef86c86a85befbe1b7d46da6a625494bd
|
| 3 |
size 6289
|