Update app.py
Browse files
app.py
CHANGED
|
@@ -52,8 +52,8 @@ def videochat(image3, prompt3):
|
|
| 52 |
prompt_len = inputs["input_ids"].shape[1]
|
| 53 |
decoded_text = processor.batch_decode(output[:, prompt_len:])[0]
|
| 54 |
if decoded_text.endswith("<|im_end|>"):
|
| 55 |
-
decoded_text = decoded_text[:-
|
| 56 |
-
yield
|
| 57 |
|
| 58 |
theme = gr.themes.Base(
|
| 59 |
font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
|
|
@@ -537,7 +537,7 @@ with gr.Blocks() as voice2:
|
|
| 537 |
with gr.Blocks() as video:
|
| 538 |
gr.Interface(
|
| 539 |
fn=videochat,
|
| 540 |
-
inputs=[gr.Image(type="pil", label="Upload Image"), gr.Textbox(label="Prompt", value="what he is doing")],
|
| 541 |
outputs=gr.Textbox(label="Answer")
|
| 542 |
)
|
| 543 |
|
|
|
|
| 52 |
prompt_len = inputs["input_ids"].shape[1]
|
| 53 |
decoded_text = processor.batch_decode(output[:, prompt_len:])[0]
|
| 54 |
if decoded_text.endswith("<|im_end|>"):
|
| 55 |
+
decoded_text = decoded_text[:-10]
|
| 56 |
+
yield decoded_text
|
| 57 |
|
| 58 |
theme = gr.themes.Base(
|
| 59 |
font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
|
|
|
|
| 537 |
with gr.Blocks() as video:
|
| 538 |
gr.Interface(
|
| 539 |
fn=videochat,
|
| 540 |
+
inputs=[gr.Image(type="pil",sources="webcam", label="Upload Image"), gr.Textbox(label="Prompt", value="what he is doing")],
|
| 541 |
outputs=gr.Textbox(label="Answer")
|
| 542 |
)
|
| 543 |
|