Venelin Valkov hai 1 ano
pai
achega
69959188f4
Modificáronse 1 ficheiros con 2 adicións e 13 borrados
  1. 2 13
      15.langchain-quickstart-with-llama-2.ipynb

+ 2 - 13
15.langchain-quickstart-with-llama-2.ipynb

@@ -8355,22 +8355,11 @@
    "cell_type": "code",
    "source": [
     "import torch\n",
-    "\n",
-    "DEVICE = \"cuda:0\" if torch.cuda.is_available() else \"cpu\"\n",
-    "MODEL_NAME = \"TheBloke/Llama-2-13b-Chat-GPTQ\""
-   ],
-   "metadata": {
-    "id": "kCRnYhmiESDF"
-   },
-   "execution_count": 4,
-   "outputs": []
-  },
-  {
-   "cell_type": "code",
-   "source": [
     "from langchain import HuggingFacePipeline\n",
     "from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig, pipeline\n",
     "\n",
+    "MODEL_NAME = \"TheBloke/Llama-2-13b-Chat-GPTQ\"\n",
+    "\n",
     "tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME, use_fast=True)\n",
     "\n",
     "model = AutoModelForCausalLM.from_pretrained(\n",