一、prompt指令制备【crawl_prompt.py】
import openai
import json
import sys
import random
openai.api_key = "" # you must provide your OpenAI API key before crawling
if not openai.api_key:
raise ValueError("OpenAI API key not provided. Please set the 'openai.api_key' variable.")
def return_random_prompt():
system_prompt = "你需要尽可能给出多样化的任务指令和对应的回答。我们将用于人工评估ChatGPT模型对指令的完成情况。要求:\n"
# generate random topics
topic_list = ["科技", "娱乐", "体育", "金融", "时政", "教育", "医疗", "旅游", "美食", "汽车", "房产", "文化", "历史", "地理", "自然", "人文", "社会", "法律", "军事", "政治", "经济", "文学", "艺术", "宗教", "哲学", "语言", "数学", "物理", "化学", "生物", "地球科学", "天文学", "计算机科学", "工程", "
文章来源地址https://www.toymoban.com/news/detail-524457.html
文章来源:https://www.toymoban.com/news/detail-524457.html
到了这里,关于LLM-项目详解-Chinese-LLaMA-AIpaca(二):代码解读【①prompt指令制作、②合并分词器、③Lora模型与基础模型合并、③模型分片保存】的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!