{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 3/3 [00:01<00:00, 2.60it/s]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Results saved to data/en_qa_output.xlsx\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "from autotab import AutoTab\n", "\n", "\n", "autotab = AutoTab(\n", " in_file_path=\"data/en_qa_input.xlsx\",\n", " out_file_path=\"data/en_qa_output.xlsx\",\n", " max_examples=5,\n", " model_name=\"Qwen/Qwen2-7B-Instruct\",\n", " api_key=\"sk-exhahhjfqyanmwewndukcqtrpegfdbwszkjucvcpajdufiah\",\n", " base_url=\"https://public-beta-api.siliconflow.cn/v1\",\n", " generation_config={\"temperature\": 0, \"max_tokens\": 128},\n", " save_every=10,\n", " instruction='You should help me classify the questions and answer them.',\n", ")\n", "autotab.run()\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "You should help me classify the questions and answer them.\n", "\n", "<Question>What is the capital of France?</Question>\n", "<Category>Geography</Category>\n", "<Answer>Paris</Answer>\n", "\n", "<Question>Who wrote '1984'?</Question>\n", "<Category>Literature</Category>\n", "<Answer>George Orwell</Answer>\n", "\n", "<Question>What is the largest planet in the solar system?</Question>\n", "<Category>Astronomy</Category>\n", "<Answer>Jupiter</Answer>\n", "\n", "<Question>Who painted the Mona Lisa?</Question>\n", "<Category>Art</Category>\n", "<Answer>Leonardo da Vinci</Answer>\n", "\n", "<Question>What is the currency of Japan?</Question>\n", "<Category>Economics</Category>\n", "<Answer>Yen</Answer>\n", "\n", "<Question>Who is the first president of the United States?</Question>\n", "\n" ] } ], "source": [ "print(autotab.query_example)" ] } ], "metadata": { "kernelspec": { "display_name": "common", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.5" } }, "nbformat": 4, "nbformat_minor": 2 }