Update README.md
Browse files
README.md
CHANGED
@@ -63,6 +63,9 @@ model = AutoModelForCausalLM.from_pretrained(
|
|
63 |
# Step 3: Load the tokenizer
|
64 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True, token = HF_TOKEN)
|
65 |
|
|
|
|
|
|
|
66 |
# Step 4: Load dataset
|
67 |
datasets = []
|
68 |
with open("./elyza-tasks-100-TV_0.jsonl", "r") as f:
|
@@ -74,6 +77,11 @@ with open("./elyza-tasks-100-TV_0.jsonl", "r") as f:
|
|
74 |
datasets.append(json.loads(item))
|
75 |
item = ""
|
76 |
|
|
|
|
|
|
|
|
|
|
|
77 |
# Step 5: Run inference on dataset
|
78 |
results = []
|
79 |
for data in tqdm(datasets):
|
|
|
63 |
# Step 3: Load the tokenizer
|
64 |
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True, token = HF_TOKEN)
|
65 |
|
66 |
+
# Integrate the LoRA adapter into the base model.
|
67 |
+
model = PeftModel.from_pretrained(model, adapter_id, token=HF_TOKEN)
|
68 |
+
|
69 |
# Step 4: Load dataset
|
70 |
datasets = []
|
71 |
with open("./elyza-tasks-100-TV_0.jsonl", "r") as f:
|
|
|
77 |
datasets.append(json.loads(item))
|
78 |
item = ""
|
79 |
|
80 |
+
# Perform inference using the model.
|
81 |
+
|
82 |
+
# Switch the model to inference mode
|
83 |
+
FastLanguageModel.for_inference(model)
|
84 |
+
|
85 |
# Step 5: Run inference on dataset
|
86 |
results = []
|
87 |
for data in tqdm(datasets):
|