Skip to content

Commit 60532db

Browse files
authored
Fixed issues in the Hybrid quantization notebook (huggingface#770)
* Fixed issues in the Hybrid quantization notebook * Fixed another failing notebook
1 parent bb9550b commit 60532db

File tree

2 files changed

+994
-39
lines changed

2 files changed

+994
-39
lines changed

notebooks/openvino/optimum_openvino_inference.ipynb

+3-3
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@
539539
"ov_pipe = pipeline(\"audio-classification\", model=model, feature_extractor=feature_extractor)\n",
540540
"\n",
541541
"# streaming=true enables loading one item from the dataset without downloading the full dataset\n",
542-
"dataset = load_dataset(\"speech_commands\", \"v0.02\", streaming=True)\n",
542+
"dataset = load_dataset(\"speech_commands\", \"v0.02\", streaming=True, trust_remote_code=True)\n",
543543
"audio_sample = next(iter(dataset[\"test\"]))"
544544
]
545545
},
@@ -894,8 +894,8 @@
894894
"from transformers import AutoTokenizer, pipeline\n",
895895
"\n",
896896
"model_id = \"helenai/t5-small-ov\"\n",
897-
"model = OVModelForSeq2SeqLM.from_pretrained(model_id, compile=False)\n",
898-
"tokenizer = AutoTokenizer.from_pretrained(model_id)\n",
897+
"model = OVModelForSeq2SeqLM.from_pretrained(model_id, compile=False, trust_remote_code=True)\n",
898+
"tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)\n",
899899
"\n",
900900
"input_ids = tokenizer(\"translate English to German: This house is wonderful.\", return_tensors=\"pt\").input_ids\n",
901901
"outputs = model.generate(input_ids, max_new_tokens=10)\n",

0 commit comments

Comments
 (0)