Open minkiapps opened 4 years ago
Please check whether you have loaded Chinese model or not.
implementation ‘com.huawei.hms : ml-computer-vision-ocr-cn-model : 2.0.2.200.013’
I have
implementation 'com.huawei.hms:ml-computer-vision-ocr-latin-model:2.0.1.300'
implementation 'com.huawei.hms:ml-computer-vision-ocr-cn-model:2.0.1.300'
implementation 'com.huawei.hms:ml-computer-vision-ocr:2.0.1.300'
We plan to release new 2.0.3.300 version on 10th September, and this issue will be fixed
please tell me as soon as they are released
I updated the version to
implementation 'com.huawei.hms:ml-computer-translate:2.0.3.300'
code is opensource, find it here now I face the issue again with translation model download failed, here the log:
E/MLInitializerProvider: MLInitializerProvider Done
E/ML_CountryCodeHelper: getVendorCountry=eu
E/ML_CountryCodeHelper: getVendorCountry equals eu or la ,not reliable
E/ML_CountryCodeHelper: getSimCountryCode by not enableNetwork, countryCode=it
E/.livetranslato: Invalid ID 0x00000000.
E/CountryCodeBean: getVendorCountry=eu
E/CountryCodeBean: getVendorCountry equals eu or la ,not reliable
E/CountryCodeBean: getSimCountryCode by not enableNetwork, countryCode=it
E/ML_TTS_SpeakerProvider: Response error! errcode=[7010] retMsg=[Token is invalid or expired]
E/ML_TTS_SpeakerProvider: Use default List; Voice list parse error.[{"retCode":"7010","retMsg":"Token is invalid or expired"}]
E/AbstractInitializer: huawei_module_mlkit_translate -> isForce = false, isCreatorClassRemote = true, isLocalExisted = true
E/AbstractInitializer: huawei_module_mlkit_translate -> The context of the dynamic module belongs to REMOTE
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/HaLogProvider: initlizeHaSdk APK mode,BUILD_MODE=APK
E/HaLogProvider: GrsApi.synGetGrsUrl=https://metrics2.data.hicloud.com:6447,BuildConfig.HIA_MODE=com.huawei.cloud.mlkithianalytics
E/CountryCodeBean: getVendorCountry=eu
E/CountryCodeBean: getVendorCountry equals eu or la ,not reliable
E/CountryCodeBean: getSimCountryCode by not enableNetwork, countryCode=it
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/AbstractInitializer: huawei_module_mlkit_translate -> Something wrong, need to switch context, current is REMOTE
E/AbstractInitializer: huawei_module_mlkit_translate -> Switch the context of the dynamic module to LOCAL
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/HaLogProvider: initlizeHaSdk APK mode,BUILD_MODE=APK
E/HaLogProvider: GrsApi.synGetGrsUrl=https://metrics2.data.hicloud.com:6447,BuildConfig.HIA_MODE=com.huawei.cloud.mlkithianalytics
E/CountryCodeBean: getVendorCountry=eu
E/CountryCodeBean: getVendorCountry equals eu or la ,not reliable
E/CountryCodeBean: getSimCountryCode by not enableNetwork, countryCode=it
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/HaLogProvider: forbiddenHiLog.getVenderCountry=UNKNOWN
E/HaLogProvider: forbiddenHiLog openHa = true
E/AbstractInitializer: huawei_module_mlkit_translate -> Something wrong, need to switch context, current is LOCAL
E/CountryCodeBean: getVendorCountry=eu
E/CountryCodeBean: getVendorCountry equals eu or la ,not reliable
E/CountryCodeBean: getSimCountryCode by not enableNetwork, countryCode=it
E/MainViewModel: Failed to download language models
java.util.concurrent.ExecutionException: com.huawei.hms.mlsdk.common.MLException: Download model failed
at com.huawei.hmf.tasks.a.j.a(Unknown Source:17)
at com.huawei.hmf.tasks.Tasks.await(Unknown Source:33)
at com.minkiapps.livetranslator.MainViewModel.downloadModel(MainViewModel.kt:60)
at com.minkiapps.livetranslator.MainViewModel.access$downloadModel(MainViewModel.kt:15)
at com.minkiapps.livetranslator.MainViewModel$initModels$2$chinesModelAvailableTask$1.invokeSuspend(MainViewModel.kt:41)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: com.huawei.hms.mlsdk.common.MLException: Download model failed
at com.huawei.hms.mlsdk.model.download.p.s.a(RemoteDownloadManager.java:162)
at com.huawei.hms.mlsdk.model.download.p.s.a(RemoteDownloadManager.java:33)
at com.huawei.hms.mlsdk.model.download.p.u.a(TranslateModelManagerDelegate.java:31)
at com.huawei.hms.mlsdk.model.download.p.e.a(ModelDownloadManagerDelegate.java:13)
at com.huawei.hms.mlsdk.model.download.MLLocalModelManager$b.call(MLLocalModelManager.java:3)
at com.huawei.hmf.tasks.a.j$1.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:929)
Hello @minkiapps
As is shown in the log, "Token is invalid or expired", the cause of "model download failed" maybe is Token is empty or invalid.
E/ML_TTS_SpeakerProvider: Response error! errcode=[7010] retMsg=[Token is invalid or expired]
We find your code is that:
MLApplication.getInstance().apiKey = config.getString("client/api_key")
The agc file has been set right? please see the wiki
Hey, I found out my app id in json file had a space in the middle, sorry on my side.
Nevertheless, my original error still persists after updating the dependency.. see first my first post. checkout my branch, as soon as I try to use the second ocr model, it stops recognising anything..
HaLogProvider和CountryCodeBean输出的极快而且量极大,如何控制不要输出这个?
I have this weird case that as sonn as I try to use more than on offline MLTextAnalyser, they stop scanning any text. If I use one only, it works.