Instructions to use D0zy/essay-model-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use D0zy/essay-model-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="D0zy/essay-model-merged", trust_remote_code=True) 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("D0zy/essay-model-merged", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("D0zy/essay-model-merged", trust_remote_code=True, 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]:])) - PEFT
How to use D0zy/essay-model-merged with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use D0zy/essay-model-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "D0zy/essay-model-merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "D0zy/essay-model-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/D0zy/essay-model-merged
- SGLang
How to use D0zy/essay-model-merged 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 "D0zy/essay-model-merged" \ --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": "D0zy/essay-model-merged", "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 "D0zy/essay-model-merged" \ --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": "D0zy/essay-model-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use D0zy/essay-model-merged with Docker Model Runner:
docker model run hf.co/D0zy/essay-model-merged
essay-model
This model is a modified (fine-tuned) version of [LiquidAI/LFM3-1.7B] by Liquid AI. It is a LoRA fine-tune of LiquidAI/LFM3-1.7B that acts as an IELTS Writing Task 2 examiner: given the task question and an essay, it outputs an overall band score followed by feedback on Task Response, Coherence & Cohesion, Lexical Resource and Grammatical Range & Accuracy.
Training
- Data: chillies/IELTS-writing-task-2-evaluation (~7,000 train examples, max 2048 tokens; loss only on the evaluation part)
- Method: LoRA (r=16, alpha=32, dropout=0.05, all linear layers), 1 epoch, lr 2e-4, cosine schedule, effective batch size 8
- Final validation loss: ~0.418
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
tok = AutoTokenizer.from_pretrained("D0zy/essay-model-merged", trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained("D0zy/essay-model-merged", trust_remote_code=True, device_map="auto", dtype=torch.bfloat16)
SYSTEM = ("You are a certified IELTS examiner. Evaluate the IELTS Writing Task 2 essay. "
"First give the overall band score, then detailed feedback on Task Response, "
"Coherence and Cohesion, Lexical Resource and Grammatical Range and Accuracy.")
msgs = [{"role": "system", "content": SYSTEM},
{"role": "user", "content": "Question:\n<task question>\n\nEssay:\n<essay>"}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=700, do_sample=False, repetition_penalty=1.05)
print(tok.decode(out[0][ids.shape[1]:], skip_special_tokens=True))
License
This model is a Derivative Work of LiquidAI/LFM3-1.7B and is distributed under the LFM Open License v1.0 (see the LICENSE file in this repository; original: https://huggingface.co/LiquidAI/LFM3-1.7B).
- Modifications: LoRA fine-tuning on IELTS essay evaluation data (by D0zy). The original model weights were not otherwise changed.
- All copyright and attribution notices of the original work are retained.
- Commercial use is only permitted for entities below the revenue threshold defined in the license (USD 10M annual revenue); see the license for details.
- This project is not affiliated with or endorsed by Liquid AI. "LFM" and "Liquid AI" are trademarks of Liquid AI.
Limitations
Scores are model estimates learned from a community dataset, not official IELTS results. Use for practice and feedback only. License terms of the base model apply.
- Downloads last month
- -