大型语言模型
常见问题解答
Section titled “FAQ”- 如何使用自定义/本地嵌入模型?
- 如何使用本地Hugging Face嵌入模型?
- 如何自定义我的提示词
- 是否需要微调我的模型?
- 我希望LLM用中文/意大利语/法语回答,但它只用英语回答,该如何处理?
- LlamaIndex是否支持GPU加速?
1. 如何定义自定义LLM?
Section titled “1. How to define a custom LLM?”您可以访问使用自定义来定义自定义LLM。
2. 如何使用不同的OpenAI模型?
Section titled “2. How to use a different OpenAI model?”要使用不同的OpenAI模型,您可以访问配置模型来设置您自己的自定义模型。
3. 如何自定义我的提示词?
Section titled “3. How can I customize my prompt?”您可以访问提示词来学习如何自定义您的提示词。
4. 是否需要对我的模型进行微调?
Section titled “4. Is it required to fine-tune my model?”不。有一些独立的模块可能会提供更好的结果,但并非必需,您可以在不需要微调模型的情况下使用 llamaindex。
5. 我希望LLM用中文/意大利语/法语回答,但它只用英语回答,该如何处理?
Section titled “5. I want to the LLM answer in Chinese/Italian/French but only answers in English, how to proceed?”为了让LLM用另一种语言回答更准确,您可以更新提示词以更强制性地指定输出语言。
response = query_engine.query("Rest of your query... \nRespond in Italian")或者:
from llama_index.core import Settingsfrom llama_index.llms.openai import OpenAI
llm = OpenAI(system_prompt="Always respond in Italian.")
# set a global llmSettings.llm = llm
query_engine = load_index_from_storage( storage_context,).as_query_engine()6. LlamaIndex是否支持GPU加速?
Section titled “6. Is LlamaIndex GPU accelerated?”是的,您可以在本地运行时让语言模型(LLM)在GPU上运行。您可以在llama2设置文档中找到配置支持GPU的LLM的示例。