Skip to content

Commit 8759d02

Browse files
fix: llm labeling path creation (#40)
1 parent 049f2b8 commit 8759d02

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/labeling_llm/module.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
import torch
66
import pandas as pd
77
from tqdm import tqdm
8+
from pathlib import Path
89
from transformers import AutoTokenizer, AutoModelForCausalLM
910

1011
# Constants
1112
MODEL_SHORT_NAME = "qwen"
12-
MODEL_NAME = "Qwen/Qwen2.5-3B-Instruct"
13+
MODEL_NAME = "Qwen/Qwen2.5-7B-Instruct"
1314
# Sample of models
14-
# "Qwen/Qwen2.5-3B-Instruct"
1515
# "Qwen/Qwen2.5-7B-Instruct"
16-
# "Qwen/Qwen2.5-14B-Instruct"
17-
# "Qwen/Qwen2.5-72B-Instruct"
16+
# "mistralai/Mistral-7B-Instruct-v0.3"
17+
# "meta-llama/Llama-3.1-8B-Instruct"
1818

1919
# Loading LLM
2020
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, trust_remote_code=True)
@@ -137,6 +137,7 @@ def labeling_from_file(input_file: str, output_file: str, test: bool = False):
137137
if test:
138138
df = df.head(5)
139139
df = labeling(df)
140+
Path(output_file).parent.mkdir(parents=True, exist_ok=True)
140141
df.to_csv(output_file, index=False)
141142
print(df)
142143
print(f"Saved {len(df)} samples to {output_file}")

0 commit comments

Comments
 (0)