allenai/sciq
Viewer β’ Updated β’ 13.7k β’ 87.7k β’ 139
How to use TechyCode/tinyllama-sciq-lora with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="TechyCode/tinyllama-sciq-lora")
messages = [
{"role": "user", "content": "Who are you?"},
]
pipe(messages) # Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("TechyCode/tinyllama-sciq-lora", dtype="auto")How to use TechyCode/tinyllama-sciq-lora with PEFT:
Task type is invalid.
How to use TechyCode/tinyllama-sciq-lora with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "TechyCode/tinyllama-sciq-lora"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/chat/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "TechyCode/tinyllama-sciq-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'docker model run hf.co/TechyCode/tinyllama-sciq-lora
How to use TechyCode/tinyllama-sciq-lora with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "TechyCode/tinyllama-sciq-lora" \
--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": "TechyCode/tinyllama-sciq-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'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 "TechyCode/tinyllama-sciq-lora" \
--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": "TechyCode/tinyllama-sciq-lora",
"messages": [
{
"role": "user",
"content": "What is the capital of France?"
}
]
}'How to use TechyCode/tinyllama-sciq-lora with Docker Model Runner:
docker model run hf.co/TechyCode/tinyllama-sciq-lora
This is a TinyLLaMA-1.1B model fine-tuned using LoRA (Low-Rank Adaptation) on the SciQ multiple-choice question answering dataset. It uses 4-bit quantization via bitsandbytes to reduce memory usage and improve inference efficiency.
This model is suitable for:
TinyLlama/TinyLlama-1.1B-Chat-v1.0allenai/sciq (Science QA)bitsandbytesq_proj, v_proj (via LoRA)from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("TechyCode/tinyllama-sciq-lora")
tokenizer = AutoTokenizer.from_pretrained("TechyCode/tinyllama-sciq-lora")
prompt = """Question: What is the boiling point of water?\nChoices:\nA. 50Β°C\nB. 75Β°C\nC. 90Β°C\nD. 100Β°C\nAnswer:"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=20)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model is released under the MIT License.
FineTuned By - Uditanshu Pandey
Linkedin - UditanshuPandey
GitHub - UditanshuPandey
Based on - TinyLLaMA-1.1B-Chat-v1.0
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "TechyCode/tinyllama-sciq-lora"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TechyCode/tinyllama-sciq-lora", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'