soiz1's picture
Upload folder using huggingface_hub
8f3f8db verified
raw
history blame contribute delete
393 Bytes
promises
await: promise
"Pause the current process until promise returns, signal an exception if the promise was rejected"
| sem result isError |
isError := false.
sem := Semaphore new.
promise
then: [:value |
result := value.
sem signal];
catch: [:error |
result := error.
isError := true.
sem signal].
sem wait.
isError ifTrue: [JSException error: result].
^result