{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
" "
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Results saved to data/en_qa_output.xlsx\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"\r"
]
}
],
"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",
" instruction=\"You should help me classify the questions and answer them.\",\n",
" max_examples=5,\n",
" model_name=\"Qwen/Qwen2-7B-Instruct\",\n",
" generation_config={\"temperature\": 0, \"max_tokens\": 128},\n",
" request_interval=0.01,\n",
" api_keys=[\"sk-exhahhjfqyanmwewndukcqtrpegfdbwszkjucvcpajdufiah\"],\n",
" base_url=\"https://public-beta-api.siliconflow.cn/v1\",\n",
" save_every=10,\n",
")\n",
"autotab.run()"
]
},
{
"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",
"What is the capital of France?\n",
"Geography\n",
"Paris\n",
"\n",
"Who wrote '1984'?\n",
"Literature\n",
"George Orwell\n",
"\n",
"What is the largest planet in the solar system?\n",
"Astronomy\n",
"Jupiter\n",
"\n",
"Who painted the Mona Lisa?\n",
"Art\n",
"Leonardo da Vinci\n",
"\n",
"What is the currency of Japan?\n",
"Economics\n",
"Yen\n",
"\n",
"Who is the first president of the United States?\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.12.2"
}
},
"nbformat": 4,
"nbformat_minor": 2
}