Text Generation
Transformers
Safetensors
English
llama
zero-shot NER
NER
conversational
text-generation-inference
Instructions to use expertai/SLIMER with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use expertai/SLIMER with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="expertai/SLIMER") 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("expertai/SLIMER") model = AutoModelForCausalLM.from_pretrained("expertai/SLIMER", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use expertai/SLIMER with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "expertai/SLIMER" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "expertai/SLIMER", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/expertai/SLIMER
- SGLang
How to use expertai/SLIMER 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 "expertai/SLIMER" \ --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": "expertai/SLIMER", "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 "expertai/SLIMER" \ --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": "expertai/SLIMER", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use expertai/SLIMER with Docker Model Runner:
docker model run hf.co/expertai/SLIMER
Update README.md
Browse files
README.md
CHANGED
|
@@ -291,6 +291,40 @@ An inverse trend can be observed, with SLIMER emerging as the most effective in
|
|
| 291 |
</body>
|
| 292 |
</html>
|
| 293 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 294 |
```python
|
| 295 |
from vllm import LLM, SamplingParams
|
| 296 |
|
|
|
|
| 291 |
</body>
|
| 292 |
</html>
|
| 293 |
|
| 294 |
+
<!DOCTYPE html>
|
| 295 |
+
<html>
|
| 296 |
+
<head>
|
| 297 |
+
<title>Hugging Face Model Interface</title>
|
| 298 |
+
</head>
|
| 299 |
+
<body>
|
| 300 |
+
<h1>Hugging Face Model Interface</h1>
|
| 301 |
+
<textarea id="inputText" rows="10" cols="50" placeholder="Paste your string with escape characters here..."></textarea>
|
| 302 |
+
<br>
|
| 303 |
+
<button onclick="processText()">Submit</button>
|
| 304 |
+
<p id="processedText"></p>
|
| 305 |
+
|
| 306 |
+
<script>
|
| 307 |
+
function processText() {
|
| 308 |
+
// Get the value from the textarea
|
| 309 |
+
let inputText = document.getElementById("inputText").value;
|
| 310 |
+
|
| 311 |
+
// Replace escape characters with their corresponding symbols
|
| 312 |
+
inputText = inputText.replace(/\\n/g, "\n");
|
| 313 |
+
inputText = inputText.replace(/\\t/g, "\t");
|
| 314 |
+
inputText = inputText.replace(/\\r/g, "\r");
|
| 315 |
+
|
| 316 |
+
// Display the processed text
|
| 317 |
+
document.getElementById("processedText").innerText = inputText;
|
| 318 |
+
|
| 319 |
+
// Here, you can also send the processed text to your Hugging Face model
|
| 320 |
+
// For example, using fetch to send a POST request to your model API
|
| 321 |
+
}
|
| 322 |
+
</script>
|
| 323 |
+
</body>
|
| 324 |
+
</html>
|
| 325 |
+
|
| 326 |
+
|
| 327 |
+
|
| 328 |
```python
|
| 329 |
from vllm import LLM, SamplingParams
|
| 330 |
|