Spaces:
Sleeping
Sleeping
Commit
·
9d020e4
1
Parent(s):
57ac8ac
Delete presets.py
Browse files- presets.py +0 -87
presets.py
DELETED
|
@@ -1,87 +0,0 @@
|
|
| 1 |
-
# -*- coding:utf-8 -*-
|
| 2 |
-
|
| 3 |
-
# ChatGPT 设置
|
| 4 |
-
initial_prompt = "You are a helpful assistant."
|
| 5 |
-
API_URL = "https://api.openai.com/v1/chat/completions"
|
| 6 |
-
HISTORY_DIR = "history"
|
| 7 |
-
TEMPLATES_DIR = "templates"
|
| 8 |
-
|
| 9 |
-
# 错误信息
|
| 10 |
-
standard_error_msg = "☹️发生了错误:" # 错误信息的标准前缀
|
| 11 |
-
error_retrieve_prompt = "请检查网络连接,或者API-Key是否有效。" # 获取对话时发生错误
|
| 12 |
-
connection_timeout_prompt = "连接超时,无法获取对话。" # 连接超时
|
| 13 |
-
read_timeout_prompt = "读取超时,无法获取对话。" # 读取超时
|
| 14 |
-
proxy_error_prompt = "代理错误,无法获取对话。" # 代理错误
|
| 15 |
-
ssl_error_prompt = "SSL错误,无法获取对话。" # SSL 错误
|
| 16 |
-
no_apikey_msg = "API key长度不是51位,请检查是否输入正确。" # API key 长度不足 51 位
|
| 17 |
-
|
| 18 |
-
max_token_streaming = 3500 # 流式对话时的最大 token 数
|
| 19 |
-
timeout_streaming = 5 # 流式对话时的超时时间
|
| 20 |
-
max_token_all = 3500 # 非流式对话时的最大 token 数
|
| 21 |
-
timeout_all = 200 # 非流式对话时的超时时间
|
| 22 |
-
enable_streaming_option = True # 是否启用选择选择是否实时显示回答的勾选框
|
| 23 |
-
HIDE_MY_KEY = False # 如果你想在UI中隐藏你的 API 密钥,将此值设置为 True
|
| 24 |
-
|
| 25 |
-
SIM_K = 5
|
| 26 |
-
INDEX_QUERY_TEMPRATURE = 1.0
|
| 27 |
-
|
| 28 |
-
title = """<h1 align="left" style="min-width:200px; margin-top:0;">川虎ChatGPT 🚀</h1>"""
|
| 29 |
-
description = """\
|
| 30 |
-
<div align="center" style="margin:16px 0">
|
| 31 |
-
|
| 32 |
-
由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536) 和 [明昭MZhao](https://space.bilibili.com/24807452)开发
|
| 33 |
-
|
| 34 |
-
访问川虎ChatGPT的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本
|
| 35 |
-
|
| 36 |
-
此App使用 `gpt-3.5-turbo` 大语言模型
|
| 37 |
-
</div>
|
| 38 |
-
"""
|
| 39 |
-
|
| 40 |
-
summarize_prompt = "你是谁?我们刚才聊了什么?" # 总结对话时的 prompt
|
| 41 |
-
|
| 42 |
-
MODELS = [
|
| 43 |
-
"gpt-3.5-turbo",
|
| 44 |
-
"gpt-3.5-turbo-0301",
|
| 45 |
-
"gpt-4",
|
| 46 |
-
"gpt-4-0314",
|
| 47 |
-
"gpt-4-32k",
|
| 48 |
-
"gpt-4-32k-0314",
|
| 49 |
-
] # 可选的模型
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
WEBSEARCH_PTOMPT_TEMPLATE = """\
|
| 53 |
-
Web search results:
|
| 54 |
-
|
| 55 |
-
{web_results}
|
| 56 |
-
Current date: {current_date}
|
| 57 |
-
|
| 58 |
-
Instructions: Using the provided web search results, write a comprehensive reply to the given query. Make sure to cite results using [[number](URL)] notation after the reference. If the provided search results refer to multiple subjects with the same name, write separate answers for each subject.
|
| 59 |
-
Query: {query}
|
| 60 |
-
Reply in 中文"""
|
| 61 |
-
|
| 62 |
-
PROMPT_TEMPLATE = """\
|
| 63 |
-
Context information is below.
|
| 64 |
-
---------------------
|
| 65 |
-
{context_str}
|
| 66 |
-
---------------------
|
| 67 |
-
Current date: {current_date}.
|
| 68 |
-
Using the provided context information, write a comprehensive reply to the given query.
|
| 69 |
-
Make sure to cite results using [number] notation after the reference.
|
| 70 |
-
If the provided context information refer to multiple subjects with the same name, write separate answers for each subject.
|
| 71 |
-
Use prior knowledge only if the given context didn't provide enough information.
|
| 72 |
-
Answer the question: {query_str}
|
| 73 |
-
Reply in 中文
|
| 74 |
-
"""
|
| 75 |
-
|
| 76 |
-
REFINE_TEMPLATE = """\
|
| 77 |
-
The original question is as follows: {query_str}
|
| 78 |
-
We have provided an existing answer: {existing_answer}
|
| 79 |
-
We have the opportunity to refine the existing answer
|
| 80 |
-
(only if needed) with some more context below.
|
| 81 |
-
------------
|
| 82 |
-
{context_msg}
|
| 83 |
-
------------
|
| 84 |
-
Given the new context, refine the original answer to better
|
| 85 |
-
Answer in the same language as the question, such as English, 中文, 日本語, Español, Français, or Deutsch.
|
| 86 |
-
If the context isn't useful, return the original answer.
|
| 87 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|