illusions
illusions
如题,不是个大问题,这个小问题在三个run_ner_xx.py里都出现了。以run_ner_span.py为例 https://github.com/lonePatient/BERT-NER-Pytorch/blob/4bae5795df64eab35a75f9bbb0cfdb9fb4cb4583/run_ner_span.py#L166-L167 这里最好还是将二者调个顺序吧~
https://github.com/lonePatient/albert_pytorch/blob/e9dbe3ce9aa49e787774b050cbdc496046e0c5bf/run_classifier.py#L110-L122 以上是run_classifier.py line110-122的代码。假如`args.gradient_accumulation_steps`取默认值1,则不会有任何问题;然而当设置`args.gradient_accumulation_steps`为其他值时,以`4`为例,外循环的前3步(即step=0~3)就无法通过line110的if判断,从而导致global_step一直为0,然后导致line116的if判断基本总能通过(缘由`global_step=0`时,`global_step % args.logging_steps == 0`恒成立),最终导致还没开始梯度更新,就做了3次无谓的`evaluate`。 所以这里可能存在一些瑕疵,我理解的是,这里的变量`global_step`应与line78```logger.info(" Total optimization steps = %d", num_training_steps)```中的num_training_steps保持一致,每进行一次梯度更新,代表实际上一个batch的数据被计算了一遍,`global_step`才+1,这也是`train()`函数最终返回的loss=`tr_loss / global_step`的原因。所以我想是否可以直接在line116、line121的判断上加一个限制`global_step != 0`,我想这样大概就可以暂时解决该问题了。
### Initial Checks - [x] I confirm that I'm using the latest version of Pydantic AI - [x] I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening...
> Static workspace support was introduced in v1.4.0, facilitating the launching of multiple instances and data isolation. Support for multiple workspaces within a single LightRAG Server will be available soon;...