danielhanchen
commited on
Commit
•
eb6366b
1
Parent(s):
89729cc
Upload Alpaca_+_Mistral_7b_full_example.ipynb
Browse files
Alpaca_+_Mistral_7b_full_example.ipynb
CHANGED
@@ -1029,51 +1029,6 @@
|
|
1029 |
"execution_count": null,
|
1030 |
"outputs": []
|
1031 |
},
|
1032 |
-
{
|
1033 |
-
"cell_type": "markdown",
|
1034 |
-
"source": [
|
1035 |
-
"Finally, we can now do some inference on the loaded model."
|
1036 |
-
],
|
1037 |
-
"metadata": {
|
1038 |
-
"id": "f8pvYYN9DvbN"
|
1039 |
-
}
|
1040 |
-
},
|
1041 |
-
{
|
1042 |
-
"cell_type": "code",
|
1043 |
-
"source": [
|
1044 |
-
"inputs = tokenizer(\n",
|
1045 |
-
"[\n",
|
1046 |
-
" alpaca_prompt.format(\n",
|
1047 |
-
" \"What is the famous tower in France called?\", # instruction\n",
|
1048 |
-
" \"\", # input\n",
|
1049 |
-
" \"\", # output\n",
|
1050 |
-
" )\n",
|
1051 |
-
"]*1, return_tensors = \"pt\").to(\"cuda\")\n",
|
1052 |
-
"\n",
|
1053 |
-
"outputs = model.generate(**inputs, max_new_tokens = 128, use_cache = True)\n",
|
1054 |
-
"tokenizer.batch_decode(outputs)"
|
1055 |
-
],
|
1056 |
-
"metadata": {
|
1057 |
-
"colab": {
|
1058 |
-
"base_uri": "https://localhost:8080/"
|
1059 |
-
},
|
1060 |
-
"id": "qWyyUoDq71jt",
|
1061 |
-
"outputId": "ab7ac76d-9e4b-4aab-9134-2e84527c0f25"
|
1062 |
-
},
|
1063 |
-
"execution_count": null,
|
1064 |
-
"outputs": [
|
1065 |
-
{
|
1066 |
-
"output_type": "execute_result",
|
1067 |
-
"data": {
|
1068 |
-
"text/plain": [
|
1069 |
-
"[\"<s> Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\\n\\n### Instruction:\\nWhat is the famous tower in France called?\\n\\n### Input:\\n\\n\\n### Response:\\nThe famous tower in France is called the Eiffel Tower. It is a wrought-iron lattice tower located on the Champ de Mars in Paris, and is one of the most recognizable structures in the world. It was built in 1889 as the entrance arch to the 1889 World's Fair, and was named after its designer, Gustave Eiffel. The tower stands 324 meters (1,063 feet) tall, and is the tallest structure in Paris. It is a popular tourist attraction, and is one of the most visited monuments in the\"]"
|
1070 |
-
]
|
1071 |
-
},
|
1072 |
-
"metadata": {},
|
1073 |
-
"execution_count": 13
|
1074 |
-
}
|
1075 |
-
]
|
1076 |
-
},
|
1077 |
{
|
1078 |
"cell_type": "markdown",
|
1079 |
"source": [
|
|
|
1029 |
"execution_count": null,
|
1030 |
"outputs": []
|
1031 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1032 |
{
|
1033 |
"cell_type": "markdown",
|
1034 |
"source": [
|