You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@BurhanUlTayyab Thanks for sharing the implementation. When running GPTZero code, I get the following error:
[/content/DetectGPT/model.py](https://localhost:8080/#) in getPPL_1(self, sentence)
374 if end_loc == seq_len:
375 break
--> 376 ppl = int(torch.exp(torch.stack(nlls).sum() / end_loc))
377 return ppl
378
**ValueError: cannot convert float NaN to integer**
The code I use to test GPTZero is:
import pandas as pd
from model import GPT2PPLV2
import torch
model = GPT2PPLV2()
res_texts = []
max_tokens = 512
filtered_list = [text for text in mylist if len(text.split()) >= 100] # Remove texts with less than 100 words
for text in filtered_list:
input_text = text[:max_tokens]
result = model(input_text, 300, "v1")
res_texts.append(result)
I have pre-processed the input text to handle NaN values or empty lines as shown below, however I still get this error when trying to run GPTZero model.
@BurhanUlTayyab Thanks for sharing the implementation. When running GPTZero code, I get the following error:
The code I use to test GPTZero is:
I have pre-processed the input text to handle NaN values or empty lines as shown below, however I still get this error when trying to run GPTZero model.
Can you please change the model.py code to handle NaN or provide a workaround to "skip" any line containing NaN when running the model?
Thanks in advance.
The text was updated successfully, but these errors were encountered: