Skip to content

Commit

Permalink
Fixed issues in the Hybrid quantization notebook (#770)
Browse files Browse the repository at this point in the history
* Fixed issues in the Hybrid quantization notebook

* Fixed another failing notebook
  • Loading branch information
AlexKoff88 authored Jun 28, 2024
1 parent bb9550b commit 60532db
Show file tree
Hide file tree
Showing 2 changed files with 994 additions and 39 deletions.
6 changes: 3 additions & 3 deletions notebooks/openvino/optimum_openvino_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@
"ov_pipe = pipeline(\"audio-classification\", model=model, feature_extractor=feature_extractor)\n",
"\n",
"# streaming=true enables loading one item from the dataset without downloading the full dataset\n",
"dataset = load_dataset(\"speech_commands\", \"v0.02\", streaming=True)\n",
"dataset = load_dataset(\"speech_commands\", \"v0.02\", streaming=True, trust_remote_code=True)\n",
"audio_sample = next(iter(dataset[\"test\"]))"
]
},
Expand Down Expand Up @@ -894,8 +894,8 @@
"from transformers import AutoTokenizer, pipeline\n",
"\n",
"model_id = \"helenai/t5-small-ov\"\n",
"model = OVModelForSeq2SeqLM.from_pretrained(model_id, compile=False)\n",
"tokenizer = AutoTokenizer.from_pretrained(model_id)\n",
"model = OVModelForSeq2SeqLM.from_pretrained(model_id, compile=False, trust_remote_code=True)\n",
"tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)\n",
"\n",
"input_ids = tokenizer(\"translate English to German: This house is wonderful.\", return_tensors=\"pt\").input_ids\n",
"outputs = model.generate(input_ids, max_new_tokens=10)\n",
Expand Down
Loading

0 comments on commit 60532db

Please sign in to comment.