Skip to content

Commit

Permalink
update pre_res
Browse files Browse the repository at this point in the history
  • Loading branch information
EachSheep committed Sep 22, 2024
1 parent 6628827 commit da3776e
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pre_experiments/all_experiments.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,16 @@ def sample_more_APIs(all_api2info, number, exclude_APIs=[]):
raise Exception("args.model_name error")
use_openai_style = True
elif args.model_name in [
"llama3.1:8b-instruct-fp16",
"qwen2:7b-instruct-fp16",
"qwen2:1.5b-instruct-fp16",
"qwen2:0.5b-instruct-fp16",
"qwen2:1.5b-instruct-fp16",
"qwen2:7b-instruct-fp16",
"qwen2.5:0.5b-instruct-fp16",
"qwen2.5:1.5b-instruct-fp16",
"qwen2.5:3b-instruct-fp16",
"qwen2.5:7b-instruct-fp16",
"gemma2:2b-instruct-fp16",
"gemma2:9b-instruct-fp16",
"llama3.1:8b-instruct-fp16",
]:
OLLAMA_BASE_URL = os.getenv("OLLAMA_BASE_URL")
OLLAMA_API_KEY = os.getenv("OLLAMA_API_KEY")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

unset http_proxy
unset https_proxy

# Collect all parameters
ARGS=("$@")

Expand Down
41 changes: 41 additions & 0 deletions pre_experiments/restart_all_experiments_llama3_8b_instruct_fp16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

unset http_proxy
unset https_proxy

# Collect all parameters
ARGS=("$@")

# Define the base command
CMD="python all_experiments.py --model_name llama3:8b-instruct-fp16"

# Check if --sample_num parameter is provided
for ((i=0; i < ${#ARGS[@]}; i++)); do
if [[ ${ARGS[$i]} == --sample_num ]]; then
SAMPLE_NUM=${ARGS[$((i+1))]}
CMD="$CMD --sample_num $SAMPLE_NUM"
break
fi
done

# Check if --dataset_name parameter is provided
for ((i=0; i < ${#ARGS[@]}; i++)); do
if [[ ${ARGS[$i]} == --dataset_name ]]; then
DATASET_NAME=${ARGS[$((i+1))]}
CMD="$CMD --dataset_name $DATASET_NAME"
break
fi
done

echo "CMD: $CMD"

# Infinite loop
while true; do
# Execute the command
$CMD
# Output termination message
echo "Program terminated, restarting..."
# Pause before restarting; adjust as needed
sleep 30
break
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

unset http_proxy
unset https_proxy

# Collect all parameters
ARGS=("$@")

# Define the base command
CMD="python all_experiments.py --model_name qwen2:1.5b-instruct-fp16"

# Check if --sample_num parameter is provided
for ((i=0; i < ${#ARGS[@]}; i++)); do
if [[ ${ARGS[$i]} == --sample_num ]]; then
SAMPLE_NUM=${ARGS[$((i+1))]}
CMD="$CMD --sample_num $SAMPLE_NUM"
break
fi
done

# Check if --dataset_name parameter is provided
for ((i=0; i < ${#ARGS[@]}; i++)); do
if [[ ${ARGS[$i]} == --dataset_name ]]; then
DATASET_NAME=${ARGS[$((i+1))]}
CMD="$CMD --dataset_name $DATASET_NAME"
break
fi
done

echo "CMD: $CMD"

# Infinite loop
while true; do
# Execute the command
$CMD
# Output termination message
echo "Program terminated, restarting..."
# Pause before restarting; adjust as needed
sleep 30
break
done
41 changes: 41 additions & 0 deletions pre_experiments/restart_all_experiments_qwen2_7b_instruct_fp16.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash

unset http_proxy
unset https_proxy

# Collect all parameters
ARGS=("$@")

# Define the base command
CMD="python all_experiments.py --model_name qwen2:7b-instruct-fp16"

# Check if --sample_num parameter is provided
for ((i=0; i < ${#ARGS[@]}; i++)); do
if [[ ${ARGS[$i]} == --sample_num ]]; then
SAMPLE_NUM=${ARGS[$((i+1))]}
CMD="$CMD --sample_num $SAMPLE_NUM"
break
fi
done

# Check if --dataset_name parameter is provided
for ((i=0; i < ${#ARGS[@]}; i++)); do
if [[ ${ARGS[$i]} == --dataset_name ]]; then
DATASET_NAME=${ARGS[$((i+1))]}
CMD="$CMD --dataset_name $DATASET_NAME"
break
fi
done

echo "CMD: $CMD"

# Infinite loop
while true; do
# Execute the command
$CMD
# Output termination message
echo "Program terminated, restarting..."
# Pause before restarting; adjust as needed
sleep 30
break
done

0 comments on commit da3776e

Please sign in to comment.