This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from typing import List, Optional, Tuple | |
import onnxruntime as onnxrt | |
import requests | |
import torch | |
from PIL import Image | |
from transformers import AutoConfig, AutoProcessor, GenerationConfig, PreTrainedModel | |
from transformers.generation import GenerationMixin | |
from transformers.modeling_outputs import BaseModelOutput, CausalLMOutputWithPast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
from typing import Optional, Tuple | |
import torch | |
from PIL import Image | |
import onnxruntime as onnxrt | |
import requests | |
from transformers import AutoConfig, AutoModelForVision2Seq, TrOCRProcessor, VisionEncoderDecoderModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from time import perf_counter | |
import numpy as np | |
from optimum.onnxruntime import ORTModelForQuestionAnswering | |
from transformers import AutoModelForQuestionAnswering, AutoTokenizer, pipeline | |
model_id = "deepset/roberta-base-squad2" | |
onnx_path = Path("onnx") | |
task = "question-answering" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import numpy as np | |
import onnxruntime | |
import torch | |
from datasets import load_dataset | |
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline | |
sess_options = onnxruntime.SessionOptions() |