Giter Site home page Giter Site logo

IndexError from alice.py about toxigen HOT 6 OPEN

microsoft avatar microsoft commented on May 18, 2024
IndexError from alice.py

from toxigen.

Comments (6)

Thartvigsen avatar Thartvigsen commented on May 18, 2024

Hi thanks for your interest in our work! Good catch in generate.py. Thanks!

The IndexError in alice.py is likely coming from changes in the GPT-3 API, though I can't confirm. It could help to investigate where that range error is coming from in the file itself and see if one of those input lists is perhaps empty? Assuming this stems from an API change, I don't have access at this point to dig into it.

from toxigen.

zqypku avatar zqypku commented on May 18, 2024

I also met these two problems.

  1. IndexError
    This is caused by predicting things like '\n', ' ', or '<|endoftext|>', which can be solved by pre-defining some stopwords.
  2. f.write(f"{response}\n")
    response here is a list of sentences. (But in your error report it seems like a dict.) So you can just print it out and see how you can extract the string to write. E.g., I changed it to:
with open(args.output_file, "a") as f:
    for r in response:
        f.write("- "+r)
    f.write('\n')

from toxigen.

Oreki-PJ avatar Oreki-PJ commented on May 18, 2024

I also met these two problems.

  1. IndexError
    This is caused by predicting things like '\n', ' ', or '<|endoftext|>', which can be solved by pre-defining some stopwords.
  2. f.write(f"{response}\n")
    response here is a list of sentences. (But in your error report it seems like a dict.) So you can just print it out and see how you can extract the string to write. E.g., I changed it to:
with open(args.output_file, "a") as f:
    for r in response:
        f.write("- "+r)
    f.write('\n')

I also met the IndexError, but i don't know where and how to pre-defining these stopwords? Can you help me? Thanks!

from toxigen.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.