-
-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace the Hyper library with HTTPX #162
Conversation
a13041f
to
2940bb0
Compare
90eaf2d
to
6783727
Compare
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
=====================================
+ Coverage 65.99% 68% +2%
=====================================
Files 13 13
Lines 3238 3147 -91
Branches 482 451 -31
=====================================
+ Hits 2137 2140 +3
+ Misses 967 890 -77
+ Partials 134 117 -17 |
f3fa85c
to
3af54b6
Compare
I am getting a JSONDecodeError on openface. |
3531ed6
to
f28812d
Compare
@ajdapretnar error is fixed now. |
Tests failing due to error in Orange biolab/orange3#4320 |
@ajdapretnar made changes connected with the progress bar here. Can you test again when you will have time. |
Things look ok now. |
The behavior regarding the internet connection should be like this:
In most cases, the widget would be without connection in the beginning already and switch is fast. The connection can be lost during embedding (but this case is very rare). In this case, the waiting time of 30 seconds is not so long in my opinion since usually, it would happen between embedding of a large set of images which already takes a few minutes. Before I was checking OSError which happens when sending images and there is no connection, now I also add checking ReadTimeout which usually happens when lost connection on slower embedders like VGG (it was not handled correctly before). So now widget should detect connection lost correctly. Widget always needs to switch to local embedder when no connection. If it does not do so it is a bug. In my case, everything works well now. @ajdapretnar can you please test again and confirm that it also works for you. It would be also good if it can be tested on Windows since there can be different behavior regarding OSError. With this version, we do not ping server to check the connection anymore, since it is not nice and implementation can be more flexible. In case that embeddings are in the local cache embeddings can be calculated without connection. |
Everything works well now, but can't merge due to failing tests. |
p.s. I'll try on Windows, too. |
Now I fixed:
|
I fixed tests and changed the strategy for embedding with different embedding. |
Issue
Fixes #146
Description of changes
With this pull request, we replace the buggy Hyper library with HTTPX.
Server embedder is now implemented as an async client which means that it is not necessary to send images in batches anymore.
This implementation improves the speed of embedding. For example embedding times of 2949 YPLP:
The current implementation uses HTTP 1.1 since HTTPX still has bugs (encode/httpx#551, encode/httpx#514) in HTTP 2 that prevent us to use it. Once they fix bugs, we can move to HTTP 2 easily by changing one line of code.
@matjazp what do you think, should we merge this even it does not implement HTTP 2? The speed improvement is quite great. If we decide to merge it, we should fix HTTPX to
~=0.9.3
since the library is still in the alpha phase and some unexpected change can case troubles.Before testing reinstall ImageAnalytics since new package must be installed
Includes