print output in gradio box
Browse files
app.py
CHANGED
@@ -28,9 +28,9 @@ def text_to_image(image, prompt):
|
|
28 |
output = model.generate(**inputs, max_new_tokens=100)
|
29 |
generated_text = processor.batch_decode(output, skip_special_tokens=True)
|
30 |
for text in generated_text:
|
31 |
-
|
|
|
32 |
|
33 |
-
print()
|
34 |
demo = gr.Interface(
|
35 |
fn=text_to_image,
|
36 |
inputs=[
|
|
|
28 |
output = model.generate(**inputs, max_new_tokens=100)
|
29 |
generated_text = processor.batch_decode(output, skip_special_tokens=True)
|
30 |
for text in generated_text:
|
31 |
+
return text.split("ASSISTANT:")[-1]
|
32 |
+
|
33 |
|
|
|
34 |
demo = gr.Interface(
|
35 |
fn=text_to_image,
|
36 |
inputs=[
|