# Longt5 summarization using huggingface sample code

**URL:** <https://discuss.huggingface.co/t/longt5-summarization-using-huggingface-sample-code/20084>\
**Category:** 🤗Transformers\
**Created:** [July 7, 2022, 5:41am UTC](https://discuss.huggingface.co/t/longt5-summarization-using-huggingface-sample-code/20084 "2022-07-07T05:41:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![saekomdalkom](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@saekomdalkom](https://discuss.huggingface.co/u/saekomdalkom)\
**Post date:** [July 7, 2022, 5:41am UTC](https://discuss.huggingface.co/t/longt5-summarization-using-huggingface-sample-code/20084/1 "2022-07-07T05:41:05Z")

</div>

Hello, I’m trying to summarize my own dataset using **longt5** model, so I used official sample code for summarization released to huggingface notebooks [here](https://github.com/huggingface/notebooks/blob/main/examples/summarization.ipynb), and there is problem.  
I checked that using my own dataset is not a problem so first I want to run this code with its offered example dataset “xsum”.  
When I run this code with xsum dataset using the original “t5-small” model it’s working well, so I only changed the model **from t5 to longt5**.  
The result is that training takes the proper time as if it’s training well, but the result is all 0 or nan value like this.  
 ![캡처](https://us1.discourse-cdn.com/hellohellohello/original/2X/c/cb8df0bc2d1790d78360602f04549cc98ca410fc.png)  
Can anyone give me some help to fix this problem? Is there a problem to compute\_metrics?

---

<div class="post-metadata">

**Author:** ![saekomdalkom](https://avatars.discourse-cdn.com/v4/letter/s/e68b1a/32.png) [@saekomdalkom](https://discuss.huggingface.co/u/saekomdalkom)\
**Post date:** [July 8, 2022, 2:24am UTC](https://discuss.huggingface.co/t/longt5-summarization-using-huggingface-sample-code/20084/2 "2022-07-08T02:24:55Z")

</div>

I fixed the problem by myself. In huggingface github there was someone claiming same issue with me. He said the problem occurs when fp16 is turned on. So I turned off fp16 and now it’s working.
