Skip to content
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

avoid client generation if already exist #324

Merged
merged 2 commits into from
Oct 7, 2024
Merged

Conversation

aniketmaurya
Copy link
Collaborator

@aniketmaurya aniketmaurya commented Oct 7, 2024

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs?
  • Did you write any new necessary tests?

What does this PR do?

avoid client generation if already exist. Caught by @bhimrazy #307 (comment)

PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in GitHub issues there's a high chance it will not be merged.

Did you have fun?

Make sure you had fun coding 🙃

@aniketmaurya aniketmaurya added the bug Something isn't working label Oct 7, 2024
@aniketmaurya aniketmaurya self-assigned this Oct 7, 2024
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 96%. Comparing base (97f7192) to head (41c5c76).
Report is 1 commits behind head on main.

Additional details and impacted files
@@         Coverage Diff         @@
##           main   #324   +/-   ##
===================================
  Coverage    95%    96%           
===================================
  Files        21     21           
  Lines      1344   1343    -1     
===================================
+ Hits       1283   1285    +2     
+ Misses       61     58    -3     

@aniketmaurya aniketmaurya enabled auto-merge (squash) October 7, 2024 10:25
@aniketmaurya aniketmaurya merged commit 0985753 into main Oct 7, 2024
19 of 20 checks passed
@aniketmaurya aniketmaurya deleted the aniket/fix-client branch October 7, 2024 10:28

# Replace the default port number with the user-specified port number
client_code = client_code.replace("{{PORT}}", str(port))
if os.path.exists(dest_path):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But is it a correct behaviour?
If I changed the port I expect that the file should be regenerated with a new, correct one.

Or maybe I am missing something?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you already have a client.py that you updated based on your server (let's say image classification). You won't want LitServe to replace the file. The generate client is supposed to be static template that people can quickly edit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants