Instructions to use Heitechsoft/FalconAlpaca-7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Heitechsoft/FalconAlpaca-7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Heitechsoft/FalconAlpaca-7B", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Heitechsoft/FalconAlpaca-7B", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Heitechsoft/FalconAlpaca-7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Heitechsoft/FalconAlpaca-7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Heitechsoft/FalconAlpaca-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Heitechsoft/FalconAlpaca-7B
- SGLang
How to use Heitechsoft/FalconAlpaca-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 "Heitechsoft/FalconAlpaca-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": "Heitechsoft/FalconAlpaca-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 "Heitechsoft/FalconAlpaca-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": "Heitechsoft/FalconAlpaca-7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Heitechsoft/FalconAlpaca-7B with Docker Model Runner:
docker model run hf.co/Heitechsoft/FalconAlpaca-7B
Commit ·
661d056
1
Parent(s): 71a6046
Updated README.md with initial information
Browse files
README.md
CHANGED
|
@@ -1,3 +1,77 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
| 4 |
+
|
| 5 |
+
# Model Card for FalconAlpaca
|
| 6 |
+
|
| 7 |
+
<!-- Provide a quick summary of what the model is/does. -->
|
| 8 |
+
|
| 9 |
+
FalconAlpaca is Falcon-7B trained on the [Stanford Alpaca Dataset](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json)
|
| 10 |
+
|
| 11 |
+
## Model Details
|
| 12 |
+
|
| 13 |
+
This model was an attempt to influence the learned outputs of Falcon-7B to adapt the outputs to become more information-rich and focused.
|
| 14 |
+
Trained using [Lit GPT](https://github.com/Lightning-AI/lit-gpt), the model took 2 hours to train on 1 4xA6000 node.
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
### Model Description
|
| 18 |
+
|
| 19 |
+
- **License:** [Apache 2.0]
|
| 20 |
+
- **Finetuned from model :** [Falcon-7B](https://huggingface.co/tiiuae/falcon-7b)
|
| 21 |
+
|
| 22 |
+
### Model Sources
|
| 23 |
+
|
| 24 |
+
[Stanford Alpaca Dataset](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json)
|
| 25 |
+
|
| 26 |
+
### Out-of-Scope Use
|
| 27 |
+
|
| 28 |
+
This model is not intended for anything but testing purposes. There have been no attempts to control/remove bias, toxicity, or any other form of
|
| 29 |
+
potentially dangerous or harmful messages.
|
| 30 |
+
|
| 31 |
+
## Bias, Risks, and Limitations
|
| 32 |
+
|
| 33 |
+
No effort was made to remove any wrong or harmful information from Falcon-7B or the Alpaca dataset. Any risks and limitations from either of
|
| 34 |
+
those datasets/models carry over to this project as well.
|
| 35 |
+
|
| 36 |
+
## How to Get Started with the Model
|
| 37 |
+
|
| 38 |
+
Download and install libraries for [Lit GPT](https://github.com/Lightning-AI/lit-gpt)
|
| 39 |
+
|
| 40 |
+
```sh
|
| 41 |
+
python generate/adapter_v2.py \
|
| 42 |
+
--adapter_path path/to/model/lit_model_adapter_finetuned.pth \
|
| 43 |
+
--checkpoint_dir path/to/model \
|
| 44 |
+
--prompt "What temperature should I cook pork at to ensure it is safe?"
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
This uses around 14GB of VRAM. If you need to use less you can read [this](https://lightning.ai/pages/blog/falcon-a-guide-to-finetune-and-inference/)
|
| 48 |
+
|
| 49 |
+
### Training Data
|
| 50 |
+
|
| 51 |
+
[Stanford Alpaca Dataset](https://github.com/tatsu-lab/stanford_alpaca/blob/main/alpaca_data.json)
|
| 52 |
+
|
| 53 |
+
### Training Procedure
|
| 54 |
+
|
| 55 |
+
Followed the guide [here](https://lightning.ai/pages/blog/falcon-a-guide-to-finetune-and-inference/)
|
| 56 |
+
|
| 57 |
+
|
| 58 |
+
#### Training Hyperparameters
|
| 59 |
+
|
| 60 |
+
The defaults were as follows
|
| 61 |
+
```
|
| 62 |
+
learning_rate = 9e-3
|
| 63 |
+
batch_size = 32
|
| 64 |
+
micro_batch_size = 2
|
| 65 |
+
gradient_accumulation_iters = 16
|
| 66 |
+
epoch_size = 50000
|
| 67 |
+
num_epochs = 5
|
| 68 |
+
max_iters = 125000
|
| 69 |
+
weight_decay = 0.02
|
| 70 |
+
warmup_iters = 50000
|
| 71 |
+
```
|
| 72 |
+
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Evaluation
|
| 76 |
+
|
| 77 |
+
[More Information Needed]
|