huggingface_load_dataset() function quit() without finishing - dataset

I try to use datasets to get "wikipedia/20200501.en" with the code below.The progress bar shows that I just complete 11% of the total dataset, however the script quit without any output in standard outut. I checked the cached directory and find the arrow file is just not completed.
wiki = load_dataset("wikipedia", "20200501.en", split="train", download_config=download_conf)
I tried several times and got different ratio of completion but never succeed in completing the progress.Could any one help me?
env:python version:3.7
datasets version:1.1.2
MacOS

This is caused by unstable network connection. It can be solved by downloading the URL with browser or "wget" function.

Related

HLS+Fairplay stream resource freeing issue

The Context
I'm using the HTML video element to play HLS+Fairplay streams (VOD and live) in Safari.
My application is a Netflix-like. You can watch a video, stop, and watch another one.
Concretly, the <video> tag is created upon each play and destroyed when the player exits.
The Problem
Sometimes, after exiting the player, launching a new video causes a MEDIA_ERR_DECODE error without anymore explation.
I can trace in my code that the Fairplay certificate and the CKC have been correctly retrieved and that the media session has been created and updated (with the CKC).
In fact, when I log everything, I see the exact same logs as when it works. Except the final MEDIA_ERR_DECODE error.
When I get this error, if I immediately retry to play, the same error happens, but if I wait about 5~10 seconds, it successfully plays. It's like some resource is waiting to be garbage-collected.
What I tried
I tried playing non-DRMed videos and it works perfectly: I could play, stop, play, etc. without any issue.
So my guess is something is happening at the EME level.
I've browse the whole Internet (twice) and couldn't come up with a clear explanation.
Most of the hints I found couldn't explain my issue (e.g. bad DRM-encryption, but how could it work the first time?) or solve it (e.g. videoElement.src = "").
I'm throwing a bottle into the sea, here...

executeOfflineCommand skips a command while executing from storage on Android

I have to execute "Start" and "Finish" Commands in the Sequential Order in my program and synchronize everything at the end. So I'm inserting the Offline commands in the order first and assuming they will execute in the same order. I'm using "List" with "Iterator" for this.
Problem here is: Finish Command will be missed execution in some strange scenarios in the middle and "start" commands will execute next to each other and sending all wrong data and mapped it in a wrong way.
As action will get ID when command executes at the server, I'm keeping tempory id's to map the offline commands in storage(localID). Instaead of List if I use anyother collection will this gets any better? It is hard to reproducing this on simulator. Please review both scenarios and advise where can this approaches go wrong. Thanks
I will add the OfflineCommands into the List and save in the Storage. After that user can perform delete delete operation in the App so that I will retrieve the list and remove the commands which got deleted from storage so now I have filtered list.
Don't synchronize.
That's nearly always a mistake in Codename One. Your code deals with the UI so it should be on the EDT and Display.getInstance().isEDT() should be true.
My guess is that one of the commands in the middle uses one of the following invokeAndBlock() derivatives:
addToQueueAndWait
Modal dialogs
Which triggers a second round of synchronization to run.
You can trace that by reproducing the issue and checking which command in the list is specifically there at each time. Then fix that command so it doesn't block in this way.
Another approach to fixing it is to remove the list immediately when you start processing which will prevent a duplicate execution of commands.

How to catch "Nrpe unable to read output" when occured?

I'm trying to catch "nrpe unable to read output" output from plugin and send an email when this one occurs and I'm a little bit stuck :) . Thing is there are different return codes when this error occurs on different plugin:
Return code Service status
0 OK
1 WARNING
2 CRITICAL
3 UNKNOWN
Is there a way either to unify return codes of all plugins I use(that there always will be 2[CRITICAL] when this problem occurs), or any other way to catch those alerts? I want to keep return codes for different situations as is(i.e. filesystem /home will be warning(return code 1) for 95% and critical(return code 2) for 98%
Most folks would rather not have this error sending alert emails, because it does not represent an actual failed check. Basically it means nothing more than:
The command/plugin (local or remote) was ran by NRPE, but
failed to return any usable status and/or text back to nrpe.
This most often means something went wrong with the command/plugin and it hasn't done the job it was expected to perform. You don't want alerts being thrown for checks, when the check wasn't actually performed - as this would be very misleading. It's also important to note that the Return Code is not even be coming from the command/plugin.
In my experience, the number one cause of this error is a bad check. And as the docs for NPRE state, you should run the check (with all its options!) to make sure it runs correctly. Do yourself a favor and test both working AND not working states. About 75% of the time, this has happened because the check only works correctly when it has OK results, and blows up when something not-OK must be reported.
Another issue that causes these are network glitches. NRPE connects and runs the check; but the connection is closed before any response is seen. Once again, not a true check result.
For a production Nagios monitoring system, these should be very rare errors. If they are happening frequently, then you likely have other issues that need to be fixed.
And as far as I can tell, all built-in Nagios plugins use the exact same set of return codes. Are you certain this isn't a 'custom' check?
Ok, I think I've found the solution for my problems-I will try to check nagios.log on each node for those errors.

Extend Store class to always execute a function after load on ExtJS

I am working on a project where we were asked to "patch" (they don't want a lot of time spent on development as they soon will replace the system) a system implemented under ExtJS 4.1.0.
That system is used under a very slow and non-stable network connection. So sometimes the stores don't get the expected data.
First two things that come to my mind as patches are:
1. Every time a store is loaded for the first time, wait 5 seconds and try again. Most times, a page refresh fix the problem of stores not loading.
Somehow, check detect that no data was received after loading a store and, try to get it again.
This patches should be executed only once to avoid infinite loops or unnecessary recursivity, given that it's ok that some times, it's ok that stores don't get any data back.
I don't like this kind of solutions but it was requested by the client.
This link should help with your question.
One of the posters suggests adding the below in an overrides.js file which is loaded in between the ExtJs source code and your applications code.
Ext.util.Observable.observe(Ext.data.Connection);
Ext.data.Connection.on('requestexception', function(dataconn, response, options){
if (response.responseText != null) {
window.document.body.innerHTML = response.responseText;
}
});
Using this example, on any error instead of echoing the error in the example you could log the error details for debugging later and try to load again. I would suggest adding some additional logic into this so that it will only retry a certain number of times otherwise it could run indefinitely while the browser window is open and more than likely crash the browser and put additional load on your server.
Obviously the root cause of the issue is not the code itself, rather your slow connection. I'd try to address this issue rather than any other.

AVAssetWriter stopped writing to file in iOS7

I am troubleshooting a problem with my application that worked fine in iOS6, but when I upgraded to XCode 5 and iOS7 the AVAssetWriter quit writing video data to a file in the tmp directory. I am using AVFoundation with an AVCaptureSession to capture the video. The output file is created when the recording begins, but it is never loaded with any video data. The finishWritingWithCompletionHandler runs without any errors and calls its completion handler as expected.
Does anyone know if I need to do anything different with iOS7 that was not needed in iOS6? I have not been successful finding anything in the documentation.
Here is some more information...
Temporary file location:
/var/mobile/Applications/[App ID]/tmp/[TempFileName].MOV
Video Sample Buffer Size: 1
Audio Sample Buffer Size: 1024
Any help will be greatly appreciated.
I've had the exact same scenario, also only over iOS 7.
On my case the problem turned to be actually a corrupted video file that was captured using same app.
The problem was that after done capturing with AVAssetWriter, I was calling 'finishWriting' on background thread and accessing the media immediately, before writing was done.
Solved it using 'finishWritingWithCompletionHandler:' and accessing file only after writing done (callback from the completion handler). Remember to dispatch back to main thread because handler called from a background thread.
Hope it helps
I discovered what the problem is. First I wrongly blamed the AVAssetWriter object. It was working correctly. The actual problem came from AVPlayerItem. I was using AVPlayerItem to determine the duration of the video. No matter what I tried it always returned a duration of zero which kept my video compilation getting called. Therefore to fix the problem I instead used AVAssetItem to get the video duration and that fixed my problem. I will probably report this to Apple as a bug in the AVPlayerItem object.
avishic was right. Before iOS 7, I didn't have to include assetWriter finishWritingWithCompletionHandler, but now it will leave the file unusable if you don't.
Here is some code to illustrate:
[assetWriterInput requestMediaDataWhenReadyOnQueue:mediaInputQueue
usingBlock:
^{
CMSampleBufferRef nextBuffer;
while (assetWriterInput.readyForMoreMediaData)
{
nextBuffer = [assetReaderOutput copyNextSampleBuffer];
if (nextBuffer) {
//...
}
else {
[assetWriterInput markAsFinished];
[assetReader cancelReading];
[assetWriter finishWritingWithCompletionHandler:^{
//notify your other code that the file is ready
}];
return;
}
}

Resources