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

Clear the torch cuda cache after response #301

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
torch.cuda.empty_cache()
  • Loading branch information
RandomGitUser321 authored Jun 26, 2024
commit 79a95a8c0a3f87d8febbd92081d97bc0541680fe
1 change: 1 addition & 0 deletions web_demo_2.5.py
Original file line number Diff line number Diff line change
@@ -150,6 +150,7 @@ def chat(img, msgs, ctx, params=None, vision_hidden_states=None):
res = res.replace('</ref>', '')
res = res.replace('<box>', '')
answer = res.replace('</box>', '')
torch.cuda.empty_cache()
return 0, answer, None, None
except Exception as err:
print(err)