Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in model output. Model's output changed to NoneType #51

Open
qaixerabbas opened this issue Mar 24, 2023 · 1 comment
Open

Issue in model output. Model's output changed to NoneType #51

qaixerabbas opened this issue Mar 24, 2023 · 1 comment

Comments

@qaixerabbas
Copy link

I used the following code to generate the augmented paraphrased sentences. After the last model's output changed to NoneType. Although I am iterating over my question lists, it outputs None. I am not sure about it and could not find any issues.

import time
ts = time.time()
augmented_questions = []
for question in finance_list:
  para_phrases = parrot.augment(input_phrase=question.lower(), use_gpu=False)
  print(f"Length of para phrased by model are: {len(para_phrases)}")
  for aug in para_phrases:
    print(f"Printing aug in this: {aug}")
    augmented_questions.append(aug)
    print(f"Appended the {aug} with type {type(aug)}")

te = time.time()
print(len(augmented_questions))
print(f"time taken to augment " + str(len(questions)) + " is "+ str(te-ts) + " seconds ")

ChatGPT suggested to add the line of code for checking the NoneType in output (line 7 below). Anyone has information why I am getting this NoneType error from model output?

import time
ts = time.time()
augmented_questions = []
#19 thy without .lower()
for question in finance_list:
  para_phrases = parrot.augment(input_phrase=question.lower(), use_gpu=False)
  if para_phrases is not None:
    print(f"Length of para phrased by model are: {len(para_phrases)}")
    for aug in para_phrases:
      print(f"Printing aug in this: {aug}")
      augmented_questions.append(aug)
      print(f"Appended the {aug} with type {type(aug)}")

te = time.time()
print(len(augmented_questions))
print(f"time taken to augment " + str(len(questions)) + " is "+ str(te-ts) + " seconds ")

@qingzhengse
Copy link

qingzhengse commented Apr 19, 2023

It will work if you lower down the threshold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants