Skip to content

IndexError from alice.py #19

Open
Open
@482c

Description

@482c

Hey!
Awesome paper and thank you for the open resources.

I am trying to reproduce generate_text.ipynb from the notebooks in Google Colab. The link in the notebook to Google Colab displayed an error so I created a duplicate here.

Date Seen
(06/05/2023)

Versions
Python 3.10

Steps to Reproduce
The bug occurred when calling alice() as shown in the notebook.

bug

The same thing happens with the command:

!python generate.py --input_prompt_file /content/drive/MyDrive/coding_projects/toxigen/prompts/neutral_black_1k.txt --language_model GPT3 --classifier RoBERTa --ALICE True --output_file test_file.txt --num_generations_per_prompt 10 --generation_mode neutral --endpoint_url https://api.openai.com/v1/engines/text-ada-001/completions --api_key <API-KEY>

There was a minor bug from generate.py, which can be resolved by rewriting the line to f.write(f"{response}\n").

Traceback (most recent call last):
  File "/mnt/c/Users/tranh/Desktop/unistuff/3iib/finalproject/chatbot-utterances/TOXIGEN-main/generate.py", line 52, in <module>
    main()
  File "/mnt/c/Users/tranh/Desktop/unistuff/3iib/finalproject/chatbot-utterances/TOXIGEN-main/generate.py", line 48, in main
    f.write(response + "\n")
TypeError: unsupported operand type(s) for +: 'dict' and 'str'

However, the main problem is IndexError and I am not sure how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions