Skip to content

IPython Debugger popped up when I ran the demo code #50

@YuehHanChen

Description

@YuehHanChen

Hello, when I tried to run the below code:

from factscore.factscorer import FactScorer

fs = FactScorer(openai_key="...")

# topics: list of strings (human entities used to generate bios)
# generations: list of strings (model generations)
out = fs.get_score(topics, generations, gamma=10)
print (out["score"]) # FActScore
print (out["init_score"]) # FActScore w/o length penalty
print (out["respond_ratio"]) # % of responding (not abstaining from answering)
print (out["num_facts_per_response"]) # average number of atomic facts per response

in which I added the openai_key, and added

topics = ['Shahnaz Pahlavi']
generations = ["""Shahnaz Pahlavi was born in Tehran on October 27, 1940. She is the first child of Mohammad Reza Pahlavi, the Shah of Iran, and his first wife Princess Fawzia of Egypt[1]. Shahnaz was educated in a Belgian boarding school, Lyc\u00e9e L\u00e9onie de Waha, in Li\u00e8ge and then in Switzerland[1]. Her father had plans for her marriage with King Faisal of Iraq which did not materialize due to her unwillingness. Her first marriage at age sixteen was to Ardeshir Zahedi[1].\n\nShahnaz's second husband was Khosrow Jahanbani. They married at the Iranian Embassy in Paris in February 1971[2]. They had two children; a son, Keykhosrow (born November 20, 1971), and a daughter, Fawzia (born 1973)[2]. Jahanbani died on April 16, 2014 after battling cancer for several years[2].\n\nShahnaz's mother-in-law was Queen Fawzia of Egypt who became Queen of Iran as the first wife of Mohammad Reza Pahlavi. With Mohammad Reza Shah Pahlavi she had one child, a daughter: HIH Princess Shahnaz Pahlavi (born October 27, 1940)[3]."""]

But then the IPython Debugger popped up like this:

Screenshot 2024-08-30 at 8 17 55 PM

Any idea of why it happened?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions