{ "cells": [ { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# 创建批处理xlsx文件\n", "\n", "import pandas as pd\n", "\n", "customid = 1\n", "method = \"POST\"\n", "url = \"/v4/chat/completions\"\n", "model = \"glm-4\"\n", "role = \"system\"\n", "instruction = \"你是生命周期领域富有经验和知识的专家。根据你所掌握的知识回答问题;不要列出几点来回答,不需要换行,只需要用1句话回答问题。\"\n", "\n", "temperature = 0.95\n", "top_p = 0.7\n", "max_tokens = 4096\n", "\n", "df = pd.DataFrame(columns=[\"custom_id\",\"method\",\"url\",\"model\",\"role\",\"content\",\"role1\",\"content1\",\"temperature\",\"top_p\",\"max_tokens\"])\n", " " ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "question = []\n", "with open(\"/home/zhangxj/WorkFile/LCA-GPT/QA/filters/question.txt\",\"r\",encoding=\"utf-8\") as file:\n", " for line in file.readlines():\n", " question.append(line.strip())" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "data = []\n", "for ques in question:\n", " row = {\n", " \"custom_id\": f\"request-{customid}\",\n", " \"method\":method,\n", " \"url\":url,\n", " \"model\":model,\n", " \"role\":role,\n", " \"content\":instruction,\n", " \"role1\":\"user\",\n", " \"content1\":ques,\n", " \"temperature\":temperature,\n", " \"top_p\":top_p,\n", " \"max_tokens\":max_tokens\n", " }\n", " data.append(row)\n", " customid+=1" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "3933" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(data)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [], "source": [ "df = pd.DataFrame(data)" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | custom_id | \n", "method | \n", "url | \n", "model | \n", "role | \n", "content | \n", "role1 | \n", "content1 | \n", "temperature | \n", "top_p | \n", "max_tokens | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "request-1 | \n", "POST | \n", "/v4/chat/completions | \n", "glm-4 | \n", "system | \n", "你是生命周期领域富有经验和知识的专家。根据你所掌握的知识回答问题;不要列出几点来回答,不需要... | \n", "user | \n", "什么是生命周期分析(LCA)的主要目标? | \n", "0.95 | \n", "0.7 | \n", "4096 | \n", "
1 | \n", "request-2 | \n", "POST | \n", "/v4/chat/completions | \n", "glm-4 | \n", "system | \n", "你是生命周期领域富有经验和知识的专家。根据你所掌握的知识回答问题;不要列出几点来回答,不需要... | \n", "user | \n", "在LCA中,如何确定研究的范围? | \n", "0.95 | \n", "0.7 | \n", "4096 | \n", "
2 | \n", "request-3 | \n", "POST | \n", "/v4/chat/completions | \n", "glm-4 | \n", "system | \n", "你是生命周期领域富有经验和知识的专家。根据你所掌握的知识回答问题;不要列出几点来回答,不需要... | \n", "user | \n", "医疗废物如何处理? | \n", "0.95 | \n", "0.7 | \n", "4096 | \n", "
3 | \n", "request-4 | \n", "POST | \n", "/v4/chat/completions | \n", "glm-4 | \n", "system | \n", "你是生命周期领域富有经验和知识的专家。根据你所掌握的知识回答问题;不要列出几点来回答,不需要... | \n", "user | \n", "LCA数据清单收集阶段需要哪些信息? | \n", "0.95 | \n", "0.7 | \n", "4096 | \n", "
4 | \n", "request-5 | \n", "POST | \n", "/v4/chat/completions | \n", "glm-4 | \n", "system | \n", "你是生命周期领域富有经验和知识的专家。根据你所掌握的知识回答问题;不要列出几点来回答,不需要... | \n", "user | \n", "生命周期影响评价阶段的目标是什么? | \n", "0.95 | \n", "0.7 | \n", "4096 | \n", "