Update app.py
Browse files
app.py
CHANGED
|
@@ -5,6 +5,7 @@ from trl import SFTTrainer
|
|
| 5 |
from transformers import TrainingArguments
|
| 6 |
from datasets import load_dataset
|
| 7 |
import gradio as gr
|
|
|
|
| 8 |
from huggingface_hub import HfApi
|
| 9 |
|
| 10 |
max_seq_length = 4096
|
|
@@ -16,7 +17,7 @@ print("Starting model and tokenizer loading...")
|
|
| 16 |
|
| 17 |
# Load the model and tokenizer
|
| 18 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 19 |
-
model_name="
|
| 20 |
max_seq_length=max_seq_length,
|
| 21 |
dtype=dtype,
|
| 22 |
load_in_4bit=load_in_4bit,
|
|
@@ -117,7 +118,7 @@ trainer = SFTTrainer(
|
|
| 117 |
bf16=is_bfloat16_supported(),
|
| 118 |
warmup_steps=5,
|
| 119 |
logging_steps=10,
|
| 120 |
-
max_steps=
|
| 121 |
optim="adamw_8bit",
|
| 122 |
weight_decay=0.01,
|
| 123 |
lr_scheduler_type="linear",
|
|
@@ -137,7 +138,7 @@ print("Model saved successfully.")
|
|
| 137 |
|
| 138 |
print("Pushing the model to the hub...")
|
| 139 |
model.push_to_hub_merged(
|
| 140 |
-
"CyberSentinel-
|
| 141 |
tokenizer,
|
| 142 |
save_method="merged_16bit",
|
| 143 |
token=hf_token
|
|
|
|
| 5 |
from transformers import TrainingArguments
|
| 6 |
from datasets import load_dataset
|
| 7 |
import gradio as gr
|
| 8 |
+
import json
|
| 9 |
from huggingface_hub import HfApi
|
| 10 |
|
| 11 |
max_seq_length = 4096
|
|
|
|
| 17 |
|
| 18 |
# Load the model and tokenizer
|
| 19 |
model, tokenizer = FastLanguageModel.from_pretrained(
|
| 20 |
+
model_name="dad1909/CyberSentinel-initial",
|
| 21 |
max_seq_length=max_seq_length,
|
| 22 |
dtype=dtype,
|
| 23 |
load_in_4bit=load_in_4bit,
|
|
|
|
| 118 |
bf16=is_bfloat16_supported(),
|
| 119 |
warmup_steps=5,
|
| 120 |
logging_steps=10,
|
| 121 |
+
max_steps=200,
|
| 122 |
optim="adamw_8bit",
|
| 123 |
weight_decay=0.01,
|
| 124 |
lr_scheduler_type="linear",
|
|
|
|
| 138 |
|
| 139 |
print("Pushing the model to the hub...")
|
| 140 |
model.push_to_hub_merged(
|
| 141 |
+
"CyberSentinel-1",
|
| 142 |
tokenizer,
|
| 143 |
save_method="merged_16bit",
|
| 144 |
token=hf_token
|