Skip to content

Commit

Permalink
Update model def in generate_qa (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
gotsysdba authored Oct 17, 2024
1 parent 53f2ef1 commit 7f0d9a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/content/test_framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def main():
# Generate Q&A
qa_file = os.path.join(state["temp_dir"], f"{file_name}_{str(qa_count)}_test_set.json")
state.qa_file = qa_file
state.test_set = utilities.generate_qa(qa_file, kb, qa_count, model=qa_llm, client=llm_client)
state.test_set = utilities.generate_qa(qa_file, kb, qa_count, client=llm_client)
placeholder.empty()
st.success("Q&A Generation Succeeded.", icon="✅")
right.button("Reset", key="reset_test_framework", type="primary", on_click=reset_test_set)
Expand Down
6 changes: 3 additions & 3 deletions app/src/modules/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,11 +700,11 @@ def build_knowledge_base(text_nodes, kb_file, llm_client, embed_client):
return knowledge_base


def generate_qa(qa_file, kb, qa_count, api="openai", model="gpt-4o-mini", client=None):
def generate_qa(qa_file, kb, qa_count, api="openai", client=None):
"""Generate an example QA"""
logger.info("QA Generation starting.. (model=%s, client=%s)", model, client)
logger.info("QA Generation starting.. (client=%s)", client)
set_llm_api(api)
set_default_client(OpenAIClient(model=model, client=client))
set_default_client(client)

test_set = generate_testset(
kb,
Expand Down

0 comments on commit 7f0d9a9

Please sign in to comment.