Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -35,13 +35,11 @@ def initialize_llm(api_key: str):
|
|
35 |
# 定义 Prompt 模板
|
36 |
def initialize_prompt_template():
|
37 |
from langchain_core.prompts import PromptTemplate
|
38 |
-
template_text = (
|
39 |
-
"请根据以下 context 回答问题,答案请使用 Markdown 格式输出。\n"
|
40 |
"如果context存在latex表达式,请正确书写。 \n"
|
41 |
"如果 context 中包含图表链接,请在回答中原封不动地加入图表,并在每个包含"/images"的链接前添加前缀 "
|
42 |
"\"https://huggingface.co/spaces/zliang/palynogeology/resolve/main\"。\n"
|
43 |
-
"Question: {question}\nContext: {context}"
|
44 |
-
)
|
45 |
return PromptTemplate(
|
46 |
input_variables=["question", "context"],
|
47 |
template=template_text
|
|
|
35 |
# 定义 Prompt 模板
|
36 |
def initialize_prompt_template():
|
37 |
from langchain_core.prompts import PromptTemplate
|
38 |
+
template_text = ("请根据以下 context 回答问题,答案请使用 Markdown 格式输出。\n"
|
|
|
39 |
"如果context存在latex表达式,请正确书写。 \n"
|
40 |
"如果 context 中包含图表链接,请在回答中原封不动地加入图表,并在每个包含"/images"的链接前添加前缀 "
|
41 |
"\"https://huggingface.co/spaces/zliang/palynogeology/resolve/main\"。\n"
|
42 |
+
"Question: {question}\nContext: {context}")
|
|
|
43 |
return PromptTemplate(
|
44 |
input_variables=["question", "context"],
|
45 |
template=template_text
|