mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-23 15:19:33 +00:00
docs: update docs for yuan2 in LLMs and Chat models integration. (#19028)
update yuan2.0 notebook in LLMs and Chat models. --------- Co-authored-by: Harrison Chase <hw.chase.17@gmail.com>
This commit is contained in:
parent
eec023766e
commit
f79d0cb9fb
@ -4,7 +4,7 @@
|
|||||||
"cell_type": "raw",
|
"cell_type": "raw",
|
||||||
"source": [
|
"source": [
|
||||||
"---\n",
|
"---\n",
|
||||||
"sidebar_label: YUAN2\n",
|
"sidebar_label: Yuan2.0\n",
|
||||||
"---"
|
"---"
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
@ -22,7 +22,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"# YUAN2.0\n",
|
"# Yuan2.0\n",
|
||||||
"\n",
|
"\n",
|
||||||
"This notebook shows how to use [YUAN2 API](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/docs/inference_server.md) in LangChain with the langchain.chat_models.ChatYuan2.\n",
|
"This notebook shows how to use [YUAN2 API](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/docs/inference_server.md) in LangChain with the langchain.chat_models.ChatYuan2.\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -96,9 +96,9 @@
|
|||||||
},
|
},
|
||||||
"source": [
|
"source": [
|
||||||
"### Setting Up Your API server\n",
|
"### Setting Up Your API server\n",
|
||||||
"Setting up your OpenAI compatible API server following [yuan2 openai api server](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/README-EN.md).\n",
|
"Setting up your OpenAI compatible API server following [yuan2 openai api server](https://github.com/IEIT-Yuan/Yuan-2.0/blob/main/docs/Yuan2_fastchat.md).\n",
|
||||||
"If you deployed api server locally, you can simply set `api_key=\"EMPTY\"` or anything you want.\n",
|
"If you deployed api server locally, you can simply set `yuan2_api_key=\"EMPTY\"` or anything you want.\n",
|
||||||
"Just make sure, the `api_base` is set correctly."
|
"Just make sure, the `yuan2_api_base` is set correctly."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"print(chat(messages))"
|
"print(chat.invoke(messages))"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -247,7 +247,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"chat(messages)"
|
"chat.invoke(messages)"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"# default infer_api for a local deployed Yuan2.0 inference server\n",
|
"# default infer_api for a local deployed Yuan2.0 inference server\n",
|
||||||
"infer_api = \"http://127.0.0.1:8000\"\n",
|
"infer_api = \"http://127.0.0.1:8000/yuan\"\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# direct access endpoint in a proxied environment\n",
|
"# direct access endpoint in a proxied environment\n",
|
||||||
"# import os\n",
|
"# import os\n",
|
||||||
@ -56,7 +56,6 @@
|
|||||||
" max_tokens=2048,\n",
|
" max_tokens=2048,\n",
|
||||||
" temp=1.0,\n",
|
" temp=1.0,\n",
|
||||||
" top_p=0.9,\n",
|
" top_p=0.9,\n",
|
||||||
" top_k=40,\n",
|
|
||||||
" use_history=False,\n",
|
" use_history=False,\n",
|
||||||
")\n",
|
")\n",
|
||||||
"\n",
|
"\n",
|
||||||
@ -89,7 +88,7 @@
|
|||||||
},
|
},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"print(yuan_llm(question))"
|
"print(yuan_llm.invoke(question))"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
Loading…
Reference in New Issue
Block a user