+
🎉 langchain-ChatGLM 项目微信交流群,如果你也对本项目感兴趣,欢迎加入群聊参与讨论交流。
diff --git a/README_en.md b/README_en.md
index 79edb913..249962da 100644
--- a/README_en.md
+++ b/README_en.md
@@ -87,6 +87,10 @@ $ conda create -p /your_path/env_name python=3.8
# Activate the environment
$ source activate /your_path/env_name
+# or, do not specify an env path, note that /your_path/env_name is to be replaced with env_name below
+$ conda create -n env_name python=3.8
+$ conda activate env_name # Activate the environment
+
# Deactivate the environment
$ source deactivate /your_path/env_name
diff --git a/agent/__init__.py b/agent/__init__.py
deleted file mode 100644
index b0f18875..00000000
--- a/agent/__init__.py
+++ /dev/null
@@ -1 +0,0 @@
-from agent.bing_search import bing_search
diff --git a/agent/agent模式实验.ipynb b/agent/agent模式实验.ipynb
deleted file mode 100644
index 19396ca6..00000000
--- a/agent/agent模式实验.ipynb
+++ /dev/null
@@ -1,747 +0,0 @@
-{
- "cells": [
- {
- "cell_type": "code",
- "execution_count": 8,
- "id": "d2ff171c-f5f8-4590-9ce0-21c87e3d5b39",
- "metadata": {},
- "outputs": [],
- "source": [
- "import sys\n",
- "sys.path.append('/media/gpt4-pdf-chatbot-langchain/dev-langchain-ChatGLM/')\n",
- "from langchain.llms.base import LLM\n",
- "import torch\n",
- "import transformers \n",
- "import models.shared as shared \n",
- "from abc import ABC\n",
- "\n",
- "from langchain.llms.base import LLM\n",
- "import random\n",
- "from transformers.generation.logits_process import LogitsProcessor\n",
- "from transformers.generation.utils import LogitsProcessorList, StoppingCriteriaList\n",
- "from typing import Optional, List, Dict, Any\n",
- "from models.loader import LoaderCheckPoint \n",
- "from models.base import (BaseAnswer,\n",
- " AnswerResult)\n",
- "\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 2,
- "id": "68978c38-c0e9-4ae9-ba90-9c02aca335be",
- "metadata": {},
- "outputs": [],
- "source": [
- "import asyncio\n",
- "from argparse import Namespace\n",
- "from models.loader.args import parser\n",
- "from langchain.agents import initialize_agent, Tool\n",
- "from langchain.agents import AgentType\n",
- " \n",
- "args = parser.parse_args(args=['--model', 'fastchat-chatglm-6b', '--no-remote-model', '--load-in-8bit'])\n",
- "\n",
- "args_dict = vars(args)\n",
- "\n",
- "shared.loaderCheckPoint = LoaderCheckPoint(args_dict)\n",
- "torch.cuda.empty_cache()\n",
- "llm=shared.loaderLLM() \n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 3,
- "id": "9baa881f-5ff2-4958-b3a2-1653a5e8bc3b",
- "metadata": {},
- "outputs": [],
- "source": [
- "import sys\n",
- "sys.path.append('/media/gpt4-pdf-chatbot-langchain/dev-langchain-ChatGLM/')\n",
- "from langchain.agents import Tool\n",
- "from langchain.tools import BaseTool\n",
- "from agent.custom_search import DeepSearch\n",
- "from agent.custom_agent import *\n",
- "\n",
- "\n",
- "tools = [\n",
- " Tool.from_function(\n",
- " func=DeepSearch.search,\n",
- " name=\"DeepSearch\",\n",
- " description=\"\"\n",
- " )\n",
- "]\n",
- "tool_names = [tool.name for tool in tools]\n",
- "output_parser = CustomOutputParser()\n",
- "prompt = CustomPromptTemplate(template=agent_template,\n",
- " tools=tools,\n",
- " input_variables=[\"related_content\",\"tool_name\", \"input\", \"intermediate_steps\"])\n",
- "\n",
- "llm_chain = LLMChain(llm=llm, prompt=prompt)\n"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 4,
- "id": "2ffd56a1-6f15-40ae-969f-68de228a9dff",
- "metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "FastChatOpenAILLM(cache=None, verbose=False, callbacks=None, callback_manager=None, api_base_url='http://localhost:8000/v1', model_name='chatglm-6b', max_token=10000, temperature=0.01, checkPoint=- {{ $t('store.onlineImportWarning') }} -
-- {{ info.desc }} -
- -- 此项目开源于 - - GitHub - - ,免费且基于 MIT 协议,没有任何形式的付费行为! -
-- 如果你觉得此项目对你有帮助,请在 GitHub 帮我点个 Star 或者给予一点赞助,谢谢! -
-{{ $t("setting.api") }}:{{ config?.apiModel ?? '-' }}
-- {{ $t("setting.monthlyUsage") }}:{{ config?.usage ?? '-' }} -
-- {{ $t("setting.reverseProxy") }}:{{ config?.reverseProxy ?? '-' }} -
-{{ $t("setting.timeout") }}:{{ config?.timeoutMs ?? '-' }}
-{{ $t("setting.socks") }}:{{ config?.socksProxy ?? '-' }}
-{{ $t("setting.httpsProxy") }}:{{ config?.httpsProxy ?? '-' }}
-- {{ dateTime }} -
-- {{ $t('common.unauthorizedTips') }} -
-- Sorry, we couldn’t find the page you’re looking for. Perhaps you’ve mistyped the URL? Be sure to check your spelling. -
-- Server error -
-