Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,8 @@ transform = transforms.Compose([transforms.ToPILImage(),transforms.Resize((image
|
|
| 27 |
model = tag2text_caption(pretrained="pretrained_models/tag2text_swin_14m.pth", image_size=image_size, vit='swin_b' )
|
| 28 |
model.eval()
|
| 29 |
model = model.to(device)
|
| 30 |
-
print("[INFO] initialize caption model success!"
|
|
|
|
| 31 |
|
| 32 |
model_T5 = SimpleT5()
|
| 33 |
if torch.cuda.is_available():
|
|
@@ -129,11 +130,11 @@ with gr.Blocks(css="#chatbot {overflow:auto; height:500px;}") as demo:
|
|
| 129 |
loadinglabel = gr.Label(label="State")
|
| 130 |
with gr.Column():
|
| 131 |
openai_api_key_textbox = gr.Textbox(
|
| 132 |
-
value=
|
| 133 |
placeholder="Paste your OpenAI API key here to start (sk-...)",
|
| 134 |
show_label=False,
|
| 135 |
lines=1,
|
| 136 |
-
type="password",
|
| 137 |
)
|
| 138 |
chatbot = gr.Chatbot(elem_id="chatbot", label="Chat_with_GPT")
|
| 139 |
state = gr.State([])
|
|
|
|
| 27 |
model = tag2text_caption(pretrained="pretrained_models/tag2text_swin_14m.pth", image_size=image_size, vit='swin_b' )
|
| 28 |
model.eval()
|
| 29 |
model = model.to(device)
|
| 30 |
+
print("[INFO] initialize caption model success!"
|
| 31 |
+
)
|
| 32 |
|
| 33 |
model_T5 = SimpleT5()
|
| 34 |
if torch.cuda.is_available():
|
|
|
|
| 130 |
loadinglabel = gr.Label(label="State")
|
| 131 |
with gr.Column():
|
| 132 |
openai_api_key_textbox = gr.Textbox(
|
| 133 |
+
value='',
|
| 134 |
placeholder="Paste your OpenAI API key here to start (sk-...)",
|
| 135 |
show_label=False,
|
| 136 |
lines=1,
|
| 137 |
+
# type="password",
|
| 138 |
)
|
| 139 |
chatbot = gr.Chatbot(elem_id="chatbot", label="Chat_with_GPT")
|
| 140 |
state = gr.State([])
|