Text Generation
Transformers
PyTorch
PEFT
English
llama
decapoda-research-7b-hf
prompt answering
text-generation-inference
8-bit precision
Instructions to use Sandiago21/llama-7b-hf-prompt-answering with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Sandiago21/llama-7b-hf-prompt-answering with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Sandiago21/llama-7b-hf-prompt-answering")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Sandiago21/llama-7b-hf-prompt-answering") model = AutoModelForCausalLM.from_pretrained("Sandiago21/llama-7b-hf-prompt-answering", device_map="auto") - PEFT
How to use Sandiago21/llama-7b-hf-prompt-answering with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Sandiago21/llama-7b-hf-prompt-answering with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Sandiago21/llama-7b-hf-prompt-answering" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Sandiago21/llama-7b-hf-prompt-answering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Sandiago21/llama-7b-hf-prompt-answering
- SGLang
How to use Sandiago21/llama-7b-hf-prompt-answering 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 "Sandiago21/llama-7b-hf-prompt-answering" \ --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": "Sandiago21/llama-7b-hf-prompt-answering", "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 "Sandiago21/llama-7b-hf-prompt-answering" \ --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": "Sandiago21/llama-7b-hf-prompt-answering", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Sandiago21/llama-7b-hf-prompt-answering with Docker Model Runner:
docker model run hf.co/Sandiago21/llama-7b-hf-prompt-answering
Commit ·
8694f72
1
Parent(s): 8f14bf4
small notebook update
Browse files
notebooks/HuggingFace-Inference.ipynb
CHANGED
|
@@ -199,6 +199,14 @@
|
|
| 199 |
")"
|
| 200 |
]
|
| 201 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 202 |
{
|
| 203 |
"cell_type": "markdown",
|
| 204 |
"id": "1f6e7df1",
|
|
@@ -399,7 +407,7 @@
|
|
| 399 |
},
|
| 400 |
{
|
| 401 |
"cell_type": "markdown",
|
| 402 |
-
"id": "
|
| 403 |
"metadata": {},
|
| 404 |
"source": [
|
| 405 |
"### Example 5"
|
|
@@ -408,7 +416,7 @@
|
|
| 408 |
{
|
| 409 |
"cell_type": "code",
|
| 410 |
"execution_count": 10,
|
| 411 |
-
"id": "
|
| 412 |
"metadata": {},
|
| 413 |
"outputs": [
|
| 414 |
{
|
|
@@ -445,6 +453,14 @@
|
|
| 445 |
"print(response)"
|
| 446 |
]
|
| 447 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 448 |
{
|
| 449 |
"cell_type": "markdown",
|
| 450 |
"id": "df08ac5a",
|
|
@@ -660,7 +676,7 @@
|
|
| 660 |
},
|
| 661 |
{
|
| 662 |
"cell_type": "markdown",
|
| 663 |
-
"id": "
|
| 664 |
"metadata": {},
|
| 665 |
"source": [
|
| 666 |
"### Example 5"
|
|
@@ -669,7 +685,7 @@
|
|
| 669 |
{
|
| 670 |
"cell_type": "code",
|
| 671 |
"execution_count": 16,
|
| 672 |
-
"id": "
|
| 673 |
"metadata": {},
|
| 674 |
"outputs": [
|
| 675 |
{
|
|
@@ -709,7 +725,7 @@
|
|
| 709 |
{
|
| 710 |
"cell_type": "code",
|
| 711 |
"execution_count": null,
|
| 712 |
-
"id": "
|
| 713 |
"metadata": {},
|
| 714 |
"outputs": [],
|
| 715 |
"source": []
|
|
|
|
| 199 |
")"
|
| 200 |
]
|
| 201 |
},
|
| 202 |
+
{
|
| 203 |
+
"cell_type": "markdown",
|
| 204 |
+
"id": "bf54befd",
|
| 205 |
+
"metadata": {},
|
| 206 |
+
"source": [
|
| 207 |
+
"## Examples with Base (decapoda-research/llama-7b-hf) model"
|
| 208 |
+
]
|
| 209 |
+
},
|
| 210 |
{
|
| 211 |
"cell_type": "markdown",
|
| 212 |
"id": "1f6e7df1",
|
|
|
|
| 407 |
},
|
| 408 |
{
|
| 409 |
"cell_type": "markdown",
|
| 410 |
+
"id": "180873e7",
|
| 411 |
"metadata": {},
|
| 412 |
"source": [
|
| 413 |
"### Example 5"
|
|
|
|
| 416 |
{
|
| 417 |
"cell_type": "code",
|
| 418 |
"execution_count": 10,
|
| 419 |
+
"id": "10b6036b",
|
| 420 |
"metadata": {},
|
| 421 |
"outputs": [
|
| 422 |
{
|
|
|
|
| 453 |
"print(response)"
|
| 454 |
]
|
| 455 |
},
|
| 456 |
+
{
|
| 457 |
+
"cell_type": "markdown",
|
| 458 |
+
"id": "64bc9354",
|
| 459 |
+
"metadata": {},
|
| 460 |
+
"source": [
|
| 461 |
+
"## Examples with Fine-Tuned model"
|
| 462 |
+
]
|
| 463 |
+
},
|
| 464 |
{
|
| 465 |
"cell_type": "markdown",
|
| 466 |
"id": "df08ac5a",
|
|
|
|
| 676 |
},
|
| 677 |
{
|
| 678 |
"cell_type": "markdown",
|
| 679 |
+
"id": "acd8e768",
|
| 680 |
"metadata": {},
|
| 681 |
"source": [
|
| 682 |
"### Example 5"
|
|
|
|
| 685 |
{
|
| 686 |
"cell_type": "code",
|
| 687 |
"execution_count": 16,
|
| 688 |
+
"id": "b05c3934",
|
| 689 |
"metadata": {},
|
| 690 |
"outputs": [
|
| 691 |
{
|
|
|
|
| 725 |
{
|
| 726 |
"cell_type": "code",
|
| 727 |
"execution_count": null,
|
| 728 |
+
"id": "569838c8",
|
| 729 |
"metadata": {},
|
| 730 |
"outputs": [],
|
| 731 |
"source": []
|