Skip to content

Commit

Permalink
fix gradio demo stripping characters
Browse files Browse the repository at this point in the history
  • Loading branch information
vikhyat committed Mar 4, 2024
1 parent a8f5d63 commit 1f86276
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.venv
__pycache__
__pycache__
checkpoints
4 changes: 2 additions & 2 deletions gradio_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ def answer_question(img, prompt):

buffer = ""
for new_text in streamer:
clean_text = re.sub("<$|END$", "", new_text)
clean_text = re.sub("<$|<END$", "", new_text)
buffer += clean_text
yield buffer.strip("<END")
yield buffer


with gr.Blocks() as demo:
Expand Down

0 comments on commit 1f86276

Please sign in to comment.