Text Generation
Transformers
PyTorch
code
RefinedWebModel
Generated from Trainer
coding
custom_code
text-generation-inference
Instructions to use mrm8488/falcoder-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mrm8488/falcoder-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrm8488/falcoder-7b", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("mrm8488/falcoder-7b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mrm8488/falcoder-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrm8488/falcoder-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrm8488/falcoder-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mrm8488/falcoder-7b
- SGLang
How to use mrm8488/falcoder-7b 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 "mrm8488/falcoder-7b" \ --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": "mrm8488/falcoder-7b", "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 "mrm8488/falcoder-7b" \ --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": "mrm8488/falcoder-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mrm8488/falcoder-7b with Docker Model Runner:
docker model run hf.co/mrm8488/falcoder-7b
Update README.md
Browse files
README.md
CHANGED
|
@@ -22,27 +22,24 @@ pipeline_tag: text-generation
|
|
| 22 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 23 |
should probably proofread and complete it, then remove this comment. -->
|
| 24 |
|
| 25 |
-
# FalCoder
|
| 26 |
**Falcon-7b** fine-tuned on the **CodeAlpaca 20k instructions dataset** by using the method **QLoRA** with [PEFT](https://github.com/huggingface/peft) library.
|
| 27 |
|
| 28 |
-
## Model description
|
| 29 |
|
| 30 |
[Falcon 7B](https://huggingface.co/tiiuae/falcon-7b)
|
| 31 |
|
| 32 |
-
## Dataset
|
| 33 |
-
|
| 34 |
-
[CodeAlpaca_20K](https://huggingface.co/datasets/HuggingFaceH4/CodeAlpaca_20K): contains 20K instruction-following data used for fine-tuning the Code Alpaca model.
|
| 35 |
|
|
|
|
| 36 |
|
| 37 |
-
|
| 38 |
|
| 39 |
-
TBA
|
| 40 |
|
| 41 |
-
### Training hyperparameters
|
| 42 |
|
| 43 |
TBA
|
| 44 |
|
| 45 |
-
### Training results
|
| 46 |
|
| 47 |
| Step | Training Loss | Validation Loss |
|
| 48 |
|------|---------------|-----------------|
|
|
@@ -54,7 +51,7 @@ TBA
|
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
-
### Example of usage
|
| 58 |
```py
|
| 59 |
import torch
|
| 60 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoTokenizer
|
|
@@ -102,4 +99,16 @@ def generate(
|
|
| 102 |
|
| 103 |
instruction = "Design a class for representing a person in Python."
|
| 104 |
print(generate(instruction))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
```
|
|
|
|
| 22 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
| 23 |
should probably proofread and complete it, then remove this comment. -->
|
| 24 |
|
| 25 |
+
# FalCoder π¦
π©βπ»
|
| 26 |
**Falcon-7b** fine-tuned on the **CodeAlpaca 20k instructions dataset** by using the method **QLoRA** with [PEFT](https://github.com/huggingface/peft) library.
|
| 27 |
|
| 28 |
+
## Model description π§
|
| 29 |
|
| 30 |
[Falcon 7B](https://huggingface.co/tiiuae/falcon-7b)
|
| 31 |
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
## Training and evaluation data π
|
| 34 |
|
| 35 |
+
[CodeAlpaca_20K](https://huggingface.co/datasets/HuggingFaceH4/CodeAlpaca_20K): contains 20K instruction-following data used for fine-tuning the Code Alpaca model.
|
| 36 |
|
|
|
|
| 37 |
|
| 38 |
+
### Training hyperparameters β
|
| 39 |
|
| 40 |
TBA
|
| 41 |
|
| 42 |
+
### Training results ποΈ
|
| 43 |
|
| 44 |
| Step | Training Loss | Validation Loss |
|
| 45 |
|------|---------------|-----------------|
|
|
|
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
+
### Example of usage π©βπ»
|
| 55 |
```py
|
| 56 |
import torch
|
| 57 |
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoTokenizer
|
|
|
|
| 99 |
|
| 100 |
instruction = "Design a class for representing a person in Python."
|
| 101 |
print(generate(instruction))
|
| 102 |
+
```
|
| 103 |
+
|
| 104 |
+
### Citation
|
| 105 |
+
```
|
| 106 |
+
@misc {manuel_romero_2023,
|
| 107 |
+
author = { {Manuel Romero} },
|
| 108 |
+
title = { falcoder-7b (Revision e061237) },
|
| 109 |
+
year = 2023,
|
| 110 |
+
url = { https://huggingface.co/mrm8488/falcoder-7b },
|
| 111 |
+
doi = { 10.57967/hf/0789 },
|
| 112 |
+
publisher = { Hugging Face }
|
| 113 |
+
}
|
| 114 |
```
|