Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from datasets import load_dataset
|
| 2 |
+
|
| 3 |
+
# 1) Dataset yükle
|
| 4 |
+
ds = load_dataset("AlicanKiraz0/Cybersecurity-Dataset-Fenrir-v2.0", split="train")
|
| 5 |
+
|
| 6 |
+
# 2) Prompt-response formatına dönüştür
|
| 7 |
+
def format_example(example):
|
| 8 |
+
system = example.get("system", "")
|
| 9 |
+
user = example.get("user", "")
|
| 10 |
+
assistant = example.get("assistant", "")
|
| 11 |
+
text = f"<|system|>\n{system}\n<|user|>\n{user}\n<|assistant|>\n{assistant}"
|
| 12 |
+
return {"text": text}
|
| 13 |
+
|
| 14 |
+
ds = ds.map(format_example, remove_columns=ds.column_names)
|
| 15 |
+
print(ds[0])
|