Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,8 @@ dmypy.json
.idea/misc.xml
.idea/workspace.xml
.idea/vcs.xml

# Local dev artifacts
venv311/
workspace/
sedna/
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
vllm
transformers
openai
accelerate
datamodel_code_generator
datamodel-code-generator
kaggle
groq
groq
retry
torch>=2.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ algorithm:
# 5> "LadeSepcDec": Lookahead Decoding framework;
values:
- "huggingface"
- "vllm"
# - "vllm" # Uncomment for Linux + CUDA environments only
# - "EagleSpecDec"

# If you're using speculative models, uncomment the following lines:
Expand Down
6 changes: 3 additions & 3 deletions examples/llm_simple_qa/benchmarkingjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ benchmarkingjob:
# job name of bechmarking; string type;
name: "benchmarkingjob"
# the url address of job workspace that will reserve the output of tests; string type;
workspace: "/home/icyfeather/project/ianvs/workspace"
workspace: "./workspace"

# the url address of test environment configuration file; string type;
# the file format supports yaml/yml;
testenv: "./examples/llm/singletask_learning_bench/simple_qa/testenv/testenv.yaml"
testenv: "./examples/llm_simple_qa/testenv/testenv.yaml"

# the configuration of test object
test_object:
Expand All @@ -19,7 +19,7 @@ benchmarkingjob:
- name: "simple_qa_singletask_learning"
# the url address of test algorithm configuration file; string type;
# the file format supports yaml/yml;
url: "./examples/llm/singletask_learning_bench/simple_qa/testalgorithms/gen/gen_algorithm.yaml"
url: "./examples/llm_simple_qa/testalgorithms/gen/gen_algorithm.yaml"

# the configuration of ranking leaderboard
rank:
Expand Down
13 changes: 9 additions & 4 deletions examples/llm_simple_qa/testalgorithms/gen/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@


from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto

import torch
device = "cuda" if torch.cuda.is_available() else "mps" if (hasattr(torch.backends, "mps") and torch.backends.mps.is_available()) else "cpu"

logging.disable(logging.WARNING)

Expand All @@ -40,12 +40,17 @@
class BaseModel:

def __init__(self, **kwargs):
model_id = "Qwen/Qwen2.5-0.5B-Instruct"
self.model = AutoModelForCausalLM.from_pretrained(
"/home/icyfeather/models/Qwen2-0.5B-Instruct",
model_id,
torch_dtype="auto",
device_map="auto"
)
self.tokenizer = AutoTokenizer.from_pretrained("/home/icyfeather/models/Qwen2-0.5B-Instruct")
self.tokenizer = AutoTokenizer.from_pretrained(model_id)

def preprocess(self, data=None, **kwargs):
print("BaseModel doesn't need to preprocess")
return data

def train(self, train_data, valid_data=None, **kwargs):
print("BaseModel doesn't need to train")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ algorithm:
# example: basemodel.py has BaseModel module that the alias is "FPN" for this benchmarking;
name: "gen"
# the url address of python module; string type;
url: "./examples/llm/singletask_learning_bench/simple_qa/testalgorithms/gen/basemodel.py"
url: "./examples/llm_simple_qa/testalgorithms/gen/basemodel.py"
6 changes: 3 additions & 3 deletions examples/llm_simple_qa/testenv/testenv.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ testenv:
# dataset configuration
dataset:
# the url address of train dataset index; string type;
train_data: "/home/icyfeather/Projects/ianvs/dataset/llm_simple_qa/train_data/data.jsonl"
train_data: "./dataset/llm_simple_qa/train_data/data.jsonl"
# the url address of test dataset index; string type;
test_data: "/home/icyfeather/Projects/ianvs/dataset/llm_simple_qa/test_data/data.jsonl"
test_data: "./dataset/llm_simple_qa/test_data/data.jsonl"

# metrics configuration for test case's evaluation; list type;
metrics:
# metric name; string type;
- name: "acc"
# the url address of python file
url: "./examples/llm/singletask_learning_bench/simple_qa/testenv/acc.py"
url: "./examples/llm_simple_qa/testenv/acc.py"