Echo-hyt / bias_self_instruct

Apache License 2.0
1 stars 0 forks source link

generate_instructions.sh #1

Open HuixueZ opened 4 months ago

HuixueZ commented 4 months ago

openai.NotFoundError: Error code: 404 - {'detail': 'Not Found'}

Traceback (most recent call last): File "/panfs/jay/groups/4/zhan1386/zhou1742/bias_self_instruct/self_instruct/gpt3_api.py", line 34, in make_requests response = openai.completions.create( File "/home/zhan1386/zhou1742/anaconda3/envs/zkx_llm/lib/python3.10/site-packages/openai/_utils/_utils.py", line 277, in wrapper return func(*args, **kwargs) File "/home/zhan1386/zhou1742/anaconda3/envs/zkx_llm/lib/python3.10/site-packages/openai/resources/completions.py", line 517, in create return self._post( File "/home/zhan1386/zhou1742/anaconda3/envs/zkx_llm/lib/python3.10/site-packages/openai/_base_client.py", line 1240, in post return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)) File "/home/zhan1386/zhou1742/anaconda3/envs/zkx_llm/lib/python3.10/site-packages/openai/_base_client.py", line 921, in request return self._request( File "/home/zhan1386/zhou1742/anaconda3/envs/zkx_llm/lib/python3.10/site-packages/openai/_base_client.py", line 1020, in _request raise self._make_status_error_from_response(err.response) from None openai.NotFoundError: Error code: 404 - {'detail': 'Not Found'}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/panfs/jay/groups/4/zhan1386/zhou1742/bias_self_instruct/self_instruct/bootstrap_instructions.py", line 196, in results = make_gpt3_requests( File "/panfs/jay/groups/4/zhan1386/zhou1742/bias_self_instruct/self_instruct/gpt3_api.py", line 53, in make_requests except openai.error.OpenAIError as e: AttributeError: module 'openai' has no attribute 'error'

Here is my command: CUDA_VISIBLE_DEVICES=0 python self_instruct/bootstrap_instructions.py --batch_dir data/gpt3_generations/ --num_instructions_to_generate 1 --batch_size 2 --engine "davinci" --output output --url http://127.0.0.1:11003 --seed_tasks_path data/gender.jsonl

model_worker: CUDA_VISIBLE_DEVICES=0 python3 -m fastchat.serve.model_worker --controller-address http://127.0.0.1:11000 --model-path ~/.cache/huggingface/hub/models--google--gemma-7b/snapshots/a0eac5b80dba224e6ed79d306df50b1e92c2125d --worker-address http://127.0.0.1:11003 --port 11003 --host 127.0.0.1 >out.model1 2>& 1 &

controller: python3 -m fastchat.serve.controller --port 11000 --host 127.0.0.1 >controller 2>& 1 &

Echo-hyt commented 4 months ago

You need to download the gemma-7b model yourself and then run “. /scripts/start_model.sh” to make sure the port can be called and then run “. /scripts/all_8_bias.sh”. If you only want to run one bias, then just run “. /scripts/generate_instructions.sh 4000 5 data/taste.jsonl taste_instruction.jsonl http://127.0.0.1:11003/v1/”。 See the readme in scripts for specific parameters.

HuixueZ commented 4 months ago

The ./scripts/start_model.sh script is not executable; it displays the error "batch accepts no parameters." For the generate_instructions.sh, could you specify what the "seed_tasks_path=$3 output=$4" should be?

Echo-hyt commented 4 months ago

Have you passed the arguments in the ./scripts/start_model.sh script? You need to run ./scripts/start_model.sh XXX. XXX is the location of gemma-7b. seed_tasks_path is similar to data/gender.jsonl, and output is the instruction output path you specify yourself.

HuixueZ commented 4 months ago

Problem: When running the /scripts/generate_instructions.sh 4000 5 data/taste.jsonl taste_instruction.jsonl It stop at this for couple hours: Loaded 11 human-written seed instructions Loaded 0 machine-generated instructions 0%| | 0/4000 [00:00<?, ?it/s]

I have start_model.sh before running this and the model has been successfully loaded.

Not sure if have any wrong step in downloading the model. I tried two method to download: 1.huggingface-cli download google/gemma-7b

  1. git clone https://huggingface.co/google/gemma-7b
HuixueZ commented 4 months ago

great, it is running now, and the estimate time for /scripts/generate_instructions.sh 4000 5 data/taste.jsonl taste_instruction.jsonl is 67:52:55

HuixueZ commented 4 months ago

Please check the error when running the /scripts/generate_instructions.sh 4000 5 data/taste.jsonl taste_instruction.jsonl:

openai.BadRequestError: Error code: 400 - {'object': 'error', 'message': 'Only allowed now, your model gemma-7b', 'code': 40301}

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/panfs/jay/groups/4/zhan1386/zhou1742/bias_self_instruct/self_instruct/bootstrap_instructions.py", line 196, in results = make_gpt3_requests( File "/panfs/jay/groups/4/zhan1386/zhou1742/bias_self_instruct/self_instruct/gpt3_api.py", line 53, in make_requests except openai.error.OpenAIError as e: AttributeError: module 'openai' has no attribute 'error' 29%|███████████████████████████████████████████████████████████████████████████▏ | 1153/4000 [8:32:47<21:06:10, 26.68s/it]

Echo-hyt commented 4 months ago

check self_instruct/gpt3_api.py if the model = "gemma-7b" or you can restart model "gemma-7b". This is probably because openai accesses the port multiple times but there is no output

HuixueZ commented 4 months ago

some issues: 1.unable to start several models by start_model.sh, this could only load the first model. I need to set up and run another start_model.sh that using another available gpu.

  1. even I start several models, I could only run one generate_instructions.sh of one of the data, if I try running another generate_instructions.sh of another data by the second loaded model, it shows that "AttributeError: module 'openai' has no attribute 'error'"(even if I restart this model lol)

Now I am running the generate_instructions.sh of one dataset, and this will stop times to times (AttributeError: module 'openai' has no attribute 'error') and need to restart.

Echo-hyt commented 4 months ago

start_model里面写的就是同时开启多个model的代码啊,你git pull一下看看是不是最新的。 你只能调用一个模型的原因是,你每一个开启的模型都有不同的端口,你需要调不同的端口。

HuixueZ commented 4 months ago

好,更新了就没问题了,谢谢