Conversation
| "User-Agent": USER_AGENT, | ||
| "Authorization": f"Bearer {self.auth_token}", | ||
| } | ||
| for attempt in range(self.max_retries + 1): |
There was a problem hiding this comment.
So you dropped the retries logic, which is probably OK, as long as we replace it with something equivalent (very likely requests has some builtin, you can dig a bit). Otherwise what is the purpose?
There was a problem hiding this comment.
The idea is to leave this decision to the user. For instance, me as a user does not want backoff by default.
There was a problem hiding this comment.
Guess you're right. This change expands scope of this PR which is irrelevant.
deepinfra/constants/client.py
Outdated
| """ | ||
|
|
||
| MAX_RETRIES = 5 | ||
| MAX_RETRIES = 0 |
There was a problem hiding this comment.
Is MAX_RETRIES even used any more?
| """ | ||
|
|
||
| def generate(self, body) -> AutomaticSpeechRecognitionResponse: | ||
| def generate(self, body): |
There was a problem hiding this comment.
I guess this steps on top of the other PR, so the same arguments apply. The generate method absolutely needs annotations on the input (body) and response.
Now I see the code is blocking (i.e not async). We should provide sync and async variants in that case.
There was a problem hiding this comment.
for annotation, I got an idea which may be scope of another PR.
Example usage
`
request = EmbeddingsRequest(inputs=["Hello World!"])
model = Embeddings()
model.generate(request)
`
By creating a request class for each base class, we can
1-) Validate the input before request is sent.
2-) Increase iteration speed for our users by improving code completion aspects.
|




No description provided.