yahma/alpaca-cleaned
Viewer • Updated • 51.8k • 25.2k • 872
How to use Sujith2121/gemma-ia3-alpaca with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Sujith2121/gemma-ia3-alpaca") # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Sujith2121/gemma-ia3-alpaca", device_map="auto")How to use Sujith2121/gemma-ia3-alpaca with PEFT:
Task type is invalid.
How to use Sujith2121/gemma-ia3-alpaca with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Sujith2121/gemma-ia3-alpaca"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Sujith2121/gemma-ia3-alpaca",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Sujith2121/gemma-ia3-alpaca
How to use Sujith2121/gemma-ia3-alpaca with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Sujith2121/gemma-ia3-alpaca" \
--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": "Sujith2121/gemma-ia3-alpaca",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'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 "Sujith2121/gemma-ia3-alpaca" \
--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": "Sujith2121/gemma-ia3-alpaca",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Sujith2121/gemma-ia3-alpaca with Docker Model Runner:
docker model run hf.co/Sujith2121/gemma-ia3-alpaca
This model is a parameter-efficient fine-tuned version of the Gemma 2B base model using IA3 (Infused Adapter by Inhibiting and Amplifying Inner Activations). It is trained on an instruction-following dataset to improve structured response generation and general task understanding.
Evaluation was performed qualitatively using prompt-based testing. The model demonstrates improved instruction-following capability compared to the base model.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("your-username/gemma-ia3-alpaca")
tokenizer = AutoTokenizer.from_pretrained("your-username/gemma-ia3-alpaca")
prompt = "### Instruction:\nExplain SQL injection attack\n\n### Response:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Base model
google/gemma-2b