falcon rw 1b code generation llm task2 modelC
简介
核心亮点
- 参数量极小,支持低功耗设备本地化部署
- 专注于代码生成,响应速度快,延迟极低
- 采用 Apache-2.0 协议,商业化使用门槛低
- 适合作为 IDE 本地补全插件的轻量化底座
使用方法
# 安装 Hugging Face transformers
pip install transformers torch
# 使用 transformers 加载模型
from transformers import AutoModel, AutoTokenizer
model = AutoModel.from_pretrained("Katochh/falcon-rw-1b-code-generation-llm-task2-modelC")
tokenizer = AutoTokenizer.from_pretrained("Katochh/falcon-rw-1b-code-generation-llm-task2-modelC")
Hugging Face 下载
我们推荐使用命令行或者 Hugging Face Hub SDK 来进行模型的下载。
操作指引:在下载前,请先通过如下命令安装 huggingface_hub:
pip install -U huggingface_hub
命令行下载
下载完整模型库
huggingface-cli download Katochh/falcon-rw-1b-code-generation-llm-task2-modelC
下载单个文件到指定本地文件夹(以下载 config.json 到当前路径下 ./dir 目录为例)
huggingface-cli download Katochh/falcon-rw-1b-code-generation-llm-task2-modelC config.json --local-dir ./dir
SDK 下载
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Katochh/falcon-rw-1b-code-generation-llm-task2-modelC')
Git 下载
请确保 lfs 已经被正确安装
git lfs install
git clone https://huggingface.co/Katochh/falcon-rw-1b-code-generation-llm-task2-modelC
如果您希望跳过 lfs 大文件下载,可以使用如下命令
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Katochh/falcon-rw-1b-code-generation-llm-task2-modelC
模型文件托管在 Hugging Face Hub,使用 HF CLI / SDK / Git 直接下载,不经过本站。
PyTorch / Transformers 使用
安装 Transformers
pip install -U transformers torch
模型加载和推理
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained('Katochh/falcon-rw-1b-code-generation-llm-task2-modelC')
tokenizer = AutoTokenizer.from_pretrained('Katochh/falcon-rw-1b-code-generation-llm-task2-modelC')
完整文档
---
license: apache-2.0
library_name: peft
tags:
- trl
- sft
- generated_from_trainer
base_model: petals-team/falcon-rw-1b
model-index:
- name: falcon-rw-1b-code-generation-llm-task2-modelC
results: []
---
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->
falcon-rw-1b-code-generation-llm-task2-modelC
This model is a fine-tuned version of petals-team/falcon-rw-1b on an unknown dataset.
It achieves the following results on the evaluation set:
- Loss: 1.6594
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 1e-05
- train_batch_size: 2
- eval_batch_size: 8
- seed: 42
- gradient_accumulation_steps: 2
- total_train_batch_size: 4
- optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08
- lr_scheduler_type: cosine
- lr_scheduler_warmup_ratio: 0.03
- training_steps: 600
Training results
| Training Loss | Epoch | Step | Validation Loss |
|:-------------:|:------:|:----:|:---------------:|
| 1.626 | 0.0356 | 20 | 1.7087 |
| 1.9368 | 0.0712 | 40 | 1.6675 |
| 1.4542 | 0.1068 | 60 | 1.6467 |
| 1.2704 | 0.1423 | 80 | 1.6474 |
| 1.1888 | 0.1779 | 100 | 1.6618 |
| 0.9006 | 0.2135 | 120 | 1.6415 |
| 1.1376 | 0.2491 | 140 | 1.6583 |
| 0.9937 | 0.2847 | 160 | 1.6454 |
| 0.8624 | 0.3203 | 180 | 1.6594 |
Framework versions
- PEFT 0.10.0
- Transformers 4.40.0
- Pytorch 2.2.1+cu121
- Datasets 2.19.0
- Tokenizers 0.19.1