Comments (6)
I guess the issue happened because I changed the 360 to 512 in below:
"pack": {
"type": "tensor_from_string",
"tokenizer": "bert",
"string": "$text",
"model_input_length": 512
},
"unpack": {
"type": "bert_decode_qa_answer",
"key": "answer"
}
}
Updated:
I changed it back to 360, and the issue still exists.
from playtorch.
@JonathanSum, can you provide information on the device, device OS, and the model that produce this error?
Does this happen just by following the PyTorch Live Question Answering tutorial?
I did a quick test with the Distilbert Q&A model that is used in the Question Answering tutorial (see screenshot).
from playtorch.
My device is oneplus7 with Android version 11.
OS is window 10. What is your testing device?
On the other hand, it gives a warning:
LOG Running "MyFirstProject" with {"rootTag":1}
WARN Possible Unhandled Promise Rejection (id: 0):
Error: 32 > 26
Error: 32 > 26
I guess 32 and 26 are somekind of gradle version.
I may do more testing with Android Studio. I think the more detailed code is in the Android Studio.
from playtorch.
Hi @JonathanSum The model runs well on my device as well. The input and output are exactly the same as @raedle .
And I believe the
Error: 32 > 26
is not referring to gradle version but the output of the models. (otherwise it is likely to throw)
The Q&A models's output is [startIndex, endIndex], and the result is constructed with the
inputTokens.slice(startIndex, endIndex+1)
The error is saying the output startIndex(32) is larger than endIndex(26), so it can't construct a valid answer.
The error seems to be thrown within the model, and we can't do much on the model capability (probably use a try catch block to display something more meaningful...)
from playtorch.
@liuyinglao thank you for answering. We all use the same model, so it should have issue. The only one thing I changed was changing the 360 to 512 . The live.json file. I will change it back to 360 and redownload the model to test it again.
If you can, please tell me more on the try and catch, so I can see the error. Is it in the native or the JavaScript side?
22-04-10-14-24-32.mp4
Sometimes it gives me an answer. But the answer is way different than yours. I saw some article that said 512 words in Bert(not distill Bert) requires 1.2 GB ram. I have 2-4 gm free ram. I am not sure.
from playtorch.
@JonathanSum Hey Jonathan, thanks for reporting the issue! The ios and android could work differently since the tokenizers are implemented in native codes:
https://github.com/pytorch/live/blob/main/react-native-pytorch-core/android/src/main/java/org/pytorch/rn/core/ml/processing/BertTokenizer.java
and the tokenizer is not perfect in the beta version.
We realized that this is not the best practice and has been working on providing a one-time implementation which has better performance than this one -- please keep an eye on an recent release :D
from playtorch.
Related Issues (20)
- PlayTorchJSIModule not found - ios & android m2 macbook pro HOT 2
- It is not possible to convert audio float32 tensor to playable uint8 audio expected by .audioFromBytes() HOT 1
- How to specify interpolation in transforms.resize?
- AudioUtil is not working on Android
- How to convert my yolov5s.pt to yolov5s.ptl HOT 1
- resize function gives error: 'Factory function resize expects 1 argument but 4 are given.'
- Cannot scan QR code from the PlayTorch app HOT 2
- playtorchjsimodule not found
- Mac M1 tutorial failure HOT 2
- unable to load local .ptl model HOT 2
- How to export a Huggingface transfromer model? HOT 3
- react_native_pytorch_core error during gradle build HOT 15
- image data fetch
- Is there a processing step im missing when using a custom trained yolo model?
- Is this project still maintained?
- Unable to work
- CMake Error
- Android build fails | Expo app using prebuild HOT 4
- 'react_native_pytorch_core-Swift.h' file not found during ios build HOT 1
- Add how to use EAS (Expo Application Service) build within this tutorial
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 playtorch.