Comments (3)
@ajliouat, you can use onnx API to modify the graph to add hidden state to graph output. @kunal-vaishnavi, is it possible to add an option to model builder to output hidden state?
from onnxruntime.
You can generate an ONNX model that outputs the hidden states using ONNX Runtime GenAI's model builder with --extra_options exclude_lm_head=true
.
If you already have the PyTorch model saved on disk:
# From wheel:
python3 -m onnxruntime_genai.models.builder -i path_to_local_folder_on_disk -o path_to_output_folder -p precision -e execution_provider -c cache_dir_to_store_temp_files --extra_options exclude_lm_head=true
# From source:
python3 builder.py -i path_to_local_folder_on_disk -o path_to_output_folder -p precision -e execution_provider -c cache_dir_to_store_temp_files --extra_options exclude_lm_head=true
If you do not have the PyTorch model saved on disk:
# From wheel:
python3 -m onnxruntime_genai.models.builder -m model_name -o path_to_output_folder -p precision -e execution_provider -c cache_dir_to_store_temp_files --extra_options exclude_lm_head=true
# From source:
python3 builder.py -m model_name -o path_to_output_folder -p precision -e execution_provider -c cache_dir_to_store_temp_files --extra_options exclude_lm_head=true
from onnxruntime.
@kunal-vaishnavi, the option -extra_options exclude_lm_head=true
only outputs last hidden state but not logits. Is there option to output both logits and last hidden state?
from onnxruntime.
Related Issues (20)
- [Documentation] Typo in tutorials at the top of the official webpage
- [Jvm] Native crash during createSession: std::bad_cast HOT 4
- [Performance] CUDA kernel not found in registries for Op type: ScatterND HOT 7
- [Training] Onnxruntime-training 1.18.0 for windows not available HOT 4
- [Performance] Whisper model inference results incorrect after Transformer Optimizer HOT 2
- [Training] Cannot export model for inferencing from session created from buffers
- [Performance] Failed to run Whisper inference after optimization with Dml EP HOT 1
- [E:onnxruntime:, qnn_execution_provider.cc:591 GetCapability] QNN SetupBackend failed qnn_backend_manager.cc:334 InitializeBackend Failed to initialize backend HOT 3
- [Feature Request] Add DFT support for CUDAExecutionProvider
- [Performance] Increased memory usage when loading from bytes HOT 5
- Can onnxruntime.quantization.quantize_dynamic() work with onnx-trt?
- CoreML EP inference result is improperly scaled HOT 3
- ORT 1.18.1 Release Candidates available for testing HOT 3
- [Build] "utf8_range::utf8_validity" does not exist HOT 5
- QDQ removal optimization from around MaxPool changes results with negative scale
- [Mobile] Cocoapods release archive zips are missing HOT 5
- [Documentation] Not able to Install phi3-vision
- Cannot create arena allocator with Environment::CreateAndRegisterAllocator on MAC M2 with clang HOT 1
- [Build] How to build for Android armeabi platform? HOT 1
- Issue with performing shape inference using symbolic_shape_infer.py with Phi-3 ONNX Models HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from onnxruntime.