Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

TypeError: string indices must be integers #734

@kruthikakr

Description

@kruthikakr

Hi not sure if it is a bug , but i am trying to follow the steps in the tutorial and found the issue
I am using Transformer model model is being downloaded

from farm.infer import *

nlp = Inferencer.load("bert-large-uncased-whole-word-masking-finetuned-squad", task_type="question_answering")

Run predictions

QA_input = [{"qas": ["Why is model conversion important?"],
"context": "Model conversion lets people easily switch between frameworks."}]
result = nlp.inference_from_dicts(dicts=QA_input)

But getting the error as :
question_text = q["question"]
TypeError: string indices must be integers

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions