# \`serving\` signature in TensorFlow Serving blogpost

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fserving-signature-in-tensorflow-serving-blogpost%2F9005%3E%5C
**Category:** Intermediate\
**Created:** [August 5, 2021, 6:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fserving-signature-in-tensorflow-serving-blogpost%2F9005 "2021-08-05T18:02:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![christopher](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/christopher/32/31595_2.png) [@christopher](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fchristopher)%5C
**Post date:** [August 5, 2021, 6:02pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fserving-signature-in-tensorflow-serving-blogpost%2F9005%2F1 "2021-08-05T18:02:04Z")

</div>

Hi everyone!

I am currently working through @jplu 's [blogpost](https://huggingface.co/blog/tf-serving) on serving a HuggingFace model with TF-Serving, in which he overwrites the model’s `serving` method to change the signature of the traced graph input to accept embeddings.

That, in turn, led me to discover that this `serving` signature is part of all TF models ([Models — transformers 4.7.0 documentation](https://huggingface.co/transformers/main_classes/model.html#transformers.TFPreTrainedModel.serving))

Can someone explain to me how exactly this `serving` method is used by the model server? I can’t find it referenced in the rest of the tutorial and I wasn’t succesful in finding my way around the codebase.

Is that redefined signature used at all in the tutorial? I might be mistaken, but it seems to me that the requests (both REST and gRPC) to the TF-server use the output of the tokenizer, not those of an embedding layer.

---

<div class="post-metadata">

**Author:** ![lewtun](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/lewtun/32/30995_2.png) [@lewtun](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Flewtun)%5C
**Post date:** [August 5, 2021, 8:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fserving-signature-in-tensorflow-serving-blogpost%2F9005%2F2 "2021-08-05T20:03:19Z")

</div>

cc @Rocketknight1

---

<div class="post-metadata">

**Author:** ![christopher](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/christopher/32/31595_2.png) [@christopher](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fchristopher)%5C
**Post date:** [August 9, 2021, 8:17am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fserving-signature-in-tensorflow-serving-blogpost%2F9005%2F3 "2021-08-09T08:17:55Z")

</div>

I missed the fact that the `serving` method is explicitly exported as a metagraph in the SavedModel for all TF models ([see here](https://github.com/huggingface/transformers/blob/3ff2cde5ca4a2d3c622b827d9edf7e3d0b7f4fb7/src/transformers/modeling_tf_utils.py#L1078))

EDIT:  
One thing that’s still not completely clear to me are the redefined inputs. The tutorial changes the `serving` method to accept token embeddings, yet the requests to the model use the output of the tokenizer, so token ids. What am I not seeing?
