Skip to content

Commit a01d982

Browse files
committed
report number of all parameters.
1 parent d5ed90e commit a01d982

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

models/janus.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,7 @@ namespace chatllm::janus::pro
540540
bool generate_next_token(const std::vector<int> &input_ids, const GenerationConfig &gen_config, std::vector<float> &lm_logits) override;
541541
void before_generate(const GenerationConfig &gen_config) override;
542542
void set_additional_args(const std::map<std::string, std::string> &args) override;
543+
int64_t get_param_num(bool effective_only) const override;
543544
protected:
544545
void decode_images(const GenerationConfig &gen_config, const std::vector<std::vector<int>> &generated_tokens);
545546
public:
@@ -751,6 +752,15 @@ namespace chatllm::janus::pro
751752
if (gen_vision) gen_vision->load("gen_vision_model.", &loader);
752753
}
753754

755+
int64_t ConditionalGeneration::get_param_num(bool effective_only) const
756+
{
757+
int64_t r = Base::get_param_num(effective_only);
758+
if (gen_head) r += gen_head->get_param_num(effective_only);
759+
if (gen_image_emb) r += gen_image_emb->get_param_num(effective_only);
760+
if (gen_vision) r += gen_vision->get_param_num(effective_only);
761+
return r;
762+
}
763+
754764
void ConditionalGeneration::set_additional_args(const std::map<std::string, std::string> &args)
755765
{
756766
parallel_size = utils::get_opt(args, "parallel_size", parallel_size);

0 commit comments

Comments
 (0)