Text Generation
Transformers
TensorBoard
Safetensors
PEFT
llama
Trained with AutoTrain
chain-of-thought
finetuned
conversational
text-generation-inference
Instructions to use devnull37/FalconMind3b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use devnull37/FalconMind3b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="devnull37/FalconMind3b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("devnull37/FalconMind3b") model = AutoModelForCausalLM.from_pretrained("devnull37/FalconMind3b", 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - PEFT
How to use devnull37/FalconMind3b with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use devnull37/FalconMind3b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "devnull37/FalconMind3b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "devnull37/FalconMind3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/devnull37/FalconMind3b
- SGLang
How to use devnull37/FalconMind3b 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 "devnull37/FalconMind3b" \ --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": "devnull37/FalconMind3b", "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 "devnull37/FalconMind3b" \ --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": "devnull37/FalconMind3b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use devnull37/FalconMind3b with Docker Model Runner:
docker model run hf.co/devnull37/FalconMind3b
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
| 2 |
tags:
|
| 3 |
- autotrain
|
| 4 |
- text-generation
|
| 5 |
- peft
|
| 6 |
-
- chain-of-
|
| 7 |
- finetuned
|
| 8 |
library_name: transformers
|
| 9 |
base_model: tiiuae/Falcon3-3B-Instruct
|
|
@@ -12,37 +14,78 @@ widget:
|
|
| 12 |
- role: user
|
| 13 |
content: What is your favorite condiment?
|
| 14 |
---
|
|
|
|
| 15 |
|
| 16 |
-
|
| 17 |
-
you can find the video explaining how this works, and more details below.
|
| 18 |
|
| 19 |
-
Model
|
| 20 |
-
This model was trained using AutoTrain. For more information, please visit [AutoTrain](https://hf.co/docs/autotrain).
|
| 21 |
|
| 22 |
-
#
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 27 |
|
| 28 |
-
model_path = "
|
| 29 |
|
|
|
|
| 30 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 31 |
model = AutoModelForCausalLM.from_pretrained(
|
| 32 |
model_path,
|
| 33 |
device_map="auto",
|
| 34 |
-
torch_dtype=
|
| 35 |
).eval()
|
| 36 |
|
| 37 |
-
#
|
| 38 |
messages = [
|
| 39 |
{"role": "user", "content": "hi"}
|
| 40 |
]
|
| 41 |
|
| 42 |
-
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
|
| 45 |
|
| 46 |
-
# Model response: "Hello! How can I assist you today?"
|
| 47 |
-
print(response)
|
| 48 |
-
```
|
|
|
|
| 1 |
---
|
| 2 |
+
# For reference on model card metadata, see the spec: https://github.com/huggingface/hub-docs/blob/main/modelcard.md?plain=1
|
| 3 |
+
# Doc / guide: https://huggingface.co/docs/hub/model-cards
|
| 4 |
tags:
|
| 5 |
- autotrain
|
| 6 |
- text-generation
|
| 7 |
- peft
|
| 8 |
+
- chain-of-thought
|
| 9 |
- finetuned
|
| 10 |
library_name: transformers
|
| 11 |
base_model: tiiuae/Falcon3-3B-Instruct
|
|
|
|
| 14 |
- role: user
|
| 15 |
content: What is your favorite condiment?
|
| 16 |
---
|
| 17 |
+
# Model Card for FalconMind3B
|
| 18 |
|
| 19 |
+
This is a fine-tuned open-source model trained to excel in **chain-of-thought reasoning**. The model is designed to process tasks step by step, providing logical and structured responses for a wide range of applications.
|
|
|
|
| 20 |
|
| 21 |
+
## Model Details
|
|
|
|
| 22 |
|
| 23 |
+
### Model Description
|
| 24 |
|
| 25 |
+
FalconMind3B is a fine-tuned variant of the tiiuae/Falcon3-3B-Instruct model. It leverages **chain-of-thought reasoning** techniques to handle complex tasks requiring step-by-step thinking. The fine-tuning process was conducted using PEFT/LoRA on the Hugging Face AutoTrain platform.
|
| 26 |
+
|
| 27 |
+
- **Developed by:** Faris Allafi
|
| 28 |
+
- **Model type:** Text-generation (causal language modeling)
|
| 29 |
+
- **Language(s) (NLP):** English
|
| 30 |
+
- **License:** Apache 2.0
|
| 31 |
+
- **Finetuned from model:** tiiuae/Falcon3-3B-Instruct
|
| 32 |
+
|
| 33 |
+
### Model Sources [optional]
|
| 34 |
+
|
| 35 |
+
- **Demo [optional]:** [Demo video link](#)
|
| 36 |
+
|
| 37 |
+
## Uses
|
| 38 |
+
|
| 39 |
+
### Direct Use
|
| 40 |
+
|
| 41 |
+
This model is designed for text generation tasks that require logical reasoning, including problem-solving, code explanations, and general Q&A applications.
|
| 42 |
+
|
| 43 |
+
### Downstream Use [optional]
|
| 44 |
+
|
| 45 |
+
FalconMind3B can be fine-tuned further for specific tasks in education, programming, or other domains requiring detailed step-by-step reasoning.
|
| 46 |
|
| 47 |
+
### Out-of-Scope Use
|
| 48 |
+
|
| 49 |
+
This model is not suitable for tasks requiring real-time interaction or applications that rely on languages other than English.
|
| 50 |
+
|
| 51 |
+
## Bias, Risks, and Limitations
|
| 52 |
+
|
| 53 |
+
FalconMind3B is fine-tuned using synthetic datasets, which may introduce biases or limitations in generalization. It is recommended to test the model on your specific use cases to ensure reliability.
|
| 54 |
+
|
| 55 |
+
### Recommendations
|
| 56 |
+
|
| 57 |
+
Users should be aware of potential biases and limitations when applying the model in high-stakes or sensitive scenarios.
|
| 58 |
+
|
| 59 |
+
## How to Get Started with the Model
|
| 60 |
+
|
| 61 |
+
Use the code below to get started with the model:
|
| 62 |
+
|
| 63 |
+
```python
|
| 64 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 65 |
|
| 66 |
+
model_path = "CoolCreator/FalconMind3b"
|
| 67 |
|
| 68 |
+
# Load tokenizer and model
|
| 69 |
tokenizer = AutoTokenizer.from_pretrained(model_path)
|
| 70 |
model = AutoModelForCausalLM.from_pretrained(
|
| 71 |
model_path,
|
| 72 |
device_map="auto",
|
| 73 |
+
torch_dtype="auto"
|
| 74 |
).eval()
|
| 75 |
|
| 76 |
+
# Define chat messages
|
| 77 |
messages = [
|
| 78 |
{"role": "user", "content": "hi"}
|
| 79 |
]
|
| 80 |
|
| 81 |
+
# Generate response
|
| 82 |
+
input_ids = tokenizer.apply_chat_template(
|
| 83 |
+
conversation=messages,
|
| 84 |
+
tokenize=True,
|
| 85 |
+
add_generation_prompt=True,
|
| 86 |
+
return_tensors="pt"
|
| 87 |
+
)
|
| 88 |
+
output_ids = model.generate(input_ids.to("cuda"))
|
| 89 |
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
|
| 90 |
|
| 91 |
+
print(response) # Model response: "Hello! How can I assist you today?"
|
|
|
|
|
|