LLMs for CRE
Collection
The models trained with Llama, and Mistral on FewRel dataset. The paper of the work has been submitted to possible journal • 20 items • Updated
How to use Sefika/mistral_fewrel_10_7 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="Sefika/mistral_fewrel_10_7") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("Sefika/mistral_fewrel_10_7")
model = AutoModelForCausalLM.from_pretrained("Sefika/mistral_fewrel_10_7")How to use Sefika/mistral_fewrel_10_7 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "Sefika/mistral_fewrel_10_7"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "Sefika/mistral_fewrel_10_7",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/Sefika/mistral_fewrel_10_7
How to use Sefika/mistral_fewrel_10_7 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "Sefika/mistral_fewrel_10_7" \
--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": "Sefika/mistral_fewrel_10_7",
"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 "Sefika/mistral_fewrel_10_7" \
--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": "Sefika/mistral_fewrel_10_7",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use Sefika/mistral_fewrel_10_7 with Docker Model Runner:
docker model run hf.co/Sefika/mistral_fewrel_10_7
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
Developed by: Sefika
Language(s) (NLP): EN
License: MIT
Finetuned from model [optional]: mistralai/Mistral-7B-Instruct-v0.2
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
tokenizer = "mistralai/Mistral-7B-Instruct-v0.2"
model_id = "Sefika/mistral_fewrel_10_7"
tokenizer = AutoTokenizer.from_pretrained(model_id, use_auth_token=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
load_in_4bit=True, # Requires bitsandbytes
torch_dtype="auto"
)
FewRel
BibTeX: The paper "Large Language Models for Continual Relation Extraction" is submitted to Springer Machine Learning journal
sefika efeoglu