Instructions to use malikali/CEFR-Aligned-LM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use malikali/CEFR-Aligned-LM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="malikali/CEFR-Aligned-LM")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("malikali/CEFR-Aligned-LM") model = AutoModelForCausalLM.from_pretrained("malikali/CEFR-Aligned-LM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use malikali/CEFR-Aligned-LM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "malikali/CEFR-Aligned-LM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "malikali/CEFR-Aligned-LM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/malikali/CEFR-Aligned-LM
- SGLang
How to use malikali/CEFR-Aligned-LM 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 "malikali/CEFR-Aligned-LM" \ --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": "malikali/CEFR-Aligned-LM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "malikali/CEFR-Aligned-LM" \ --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": "malikali/CEFR-Aligned-LM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use malikali/CEFR-Aligned-LM with Docker Model Runner:
docker model run hf.co/malikali/CEFR-Aligned-LM
CEFF-Aligned Language Model (CaLM)
This is a model card for the CEFF-Aligned Language Model (CaLM) from the paper: From Tarzan to Tolkien: Controlling the Language Proficiency Level of LLMs for Content Generation
- Paper: https://aclanthology.org/2024.findings-acl.926
- Arxiv: https://arxiv.org/abs/2406.03030
- Github: https://github.com/malik-ali/tarzan2tolkien
Prompt Template
The model text template looks like
<<Summary>>: {summary}
<<CEFR>>: {cefr}
<<Story>>:
{story}
<</Story>>
where you replace {summary} with the summary of the desired story to generate and {cefr} with the desired CEFR level is one of ["A1", "A2", "B1", "B2", "C1", "C2"].
To generate, you can add the summary and target CEFR level and just start generating after the <<Story>>:\n . See the Github repo for examples.
- Downloads last month
- 53
Model tree for malikali/CEFR-Aligned-LM
Base model
meta-llama/Llama-2-7b-hf