Fix hook counters for non-generation calls by adding a flag to indicate whether we are in the "generate" call or not.
Similar to the hooks, this implementation can have unintended behavior if the program crashes in the middle of the generate call, which will leave the _is_generation to True. It would be great if we could find better indicators for the "generate" call.
Fix hook counters for non-generation calls by adding a flag to indicate whether we are in the "generate" call or not.
Similar to the hooks, this implementation can have unintended behavior if the program crashes in the middle of the generate call, which will leave the _is_generation to True. It would be great if we could find better indicators for the "generate" call.