Replies: 1 comment 2 replies
-
@li-hhhh 你好!我是Dosu,一个可以帮助您解决错误、回答问题并成为贡献者的机器人。如果您需要任何帮助,请告诉我。 是的,可以使用本地模型或Hugging Face上的模型来构建知识图谱,并且可以避免类似 以下是使用Hugging Face模型与LlamaIndex构建知识图谱的示例:
此外,可以使用LlamaIndex中的 from llama_index.llms.openai_like import OpenAILike
# 设置模型为Hugging Face模型
model = OpenAILike(
model="gpt-3.5-turbo",
tokenizer="gpt-3.5-turbo",
api_key="your_api_key",
api_base="https://api.openai.com/v1"
)
# 使用模型进行补全
response = model.complete(prompt="Your prompt here")
print(response) 对于知识图谱构建,可以使用Hugging Face上的REBEL模型进行三元组提取:
这种方法确保您可以使用Hugging Face模型,同时避免 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我尝试过,只有嵌入模型可以。如果可行,那有什么本地模型或者huggingface中的模型推荐去替换Openai吗?

当使用本地模型或者huggingface中的模型去替换openai的模型时,总是报错显示缺一些东西,如predict,metadata
Beta Was this translation helpful? Give feedback.
All reactions