Spaces:
Runtime error
Runtime error
Monius
commited on
Commit
Β·
50e7d4a
1
Parent(s):
b7c7aa0
V0.1 by <M0n-ius>
Browse files
run.py
CHANGED
@@ -33,7 +33,16 @@ with gr.Blocks() as Core:
|
|
33 |
frame_skip = gr.Slider(2, 100, 2, step=1, label="Frame Skip")
|
34 |
group_size = gr.Slider(1, 100, 10, step=1, label="Group Size")
|
35 |
prompt = gr.Textbox(SYS_PROMPT, label="Prompt", lines=10, max_lines=100, show_copy_button=True)
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37 |
with gr.Column(scale=2):
|
38 |
with gr.Column():
|
39 |
with gr.Accordion("Model Provider", open=True):
|
@@ -42,16 +51,35 @@ with gr.Blocks() as Core:
|
|
42 |
model = gr.Dropdown(label="Model", value="GPT-4o", choices=["GPT-4o", "GPT-4v"], interactive=False)
|
43 |
key = gr.Textbox(label="Azure API Key")
|
44 |
endpoint = gr.Textbox(label="Azure Endpoint")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
with gr.Accordion("Data Source", open=True):
|
46 |
with gr.Tabs():
|
47 |
with gr.Tab("Upload"):
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
caption_button = gr.Button("Caption", variant="primary", size="lg")
|
50 |
caption_button.click(
|
51 |
process_caption,
|
52 |
-
inputs=[prompt, temp, top_p, max_tokens, model, key, endpoint,
|
53 |
outputs=[result, info, frame]
|
54 |
)
|
55 |
|
56 |
if __name__ == "__main__":
|
57 |
Core.launch()
|
|
|
|
33 |
frame_skip = gr.Slider(2, 100, 2, step=1, label="Frame Skip")
|
34 |
group_size = gr.Slider(1, 100, 10, step=1, label="Group Size")
|
35 |
prompt = gr.Textbox(SYS_PROMPT, label="Prompt", lines=10, max_lines=100, show_copy_button=True)
|
36 |
+
with gr.Tabs():
|
37 |
+
with gr.Tab("Azure"):
|
38 |
+
result = gr.Textbox(label="Result", lines=15, max_lines=100, show_copy_button=True, interactive=False)
|
39 |
+
with gr.Tab("Google"):
|
40 |
+
result_gg = gr.Textbox(label="Result", lines=15, max_lines=100, show_copy_button=True, interactive=False)
|
41 |
+
with gr.Tab("Anthropic"):
|
42 |
+
result_ac = gr.Textbox(label="Result", lines=15, max_lines=100, show_copy_button=True, interactive=False)
|
43 |
+
with gr.Tab("OpenAI"):
|
44 |
+
result_oai = gr.Textbox(label="Result", lines=15, max_lines=100, show_copy_button=True, interactive=False)
|
45 |
+
|
46 |
with gr.Column(scale=2):
|
47 |
with gr.Column():
|
48 |
with gr.Accordion("Model Provider", open=True):
|
|
|
51 |
model = gr.Dropdown(label="Model", value="GPT-4o", choices=["GPT-4o", "GPT-4v"], interactive=False)
|
52 |
key = gr.Textbox(label="Azure API Key")
|
53 |
endpoint = gr.Textbox(label="Azure Endpoint")
|
54 |
+
with gr.Tab("Google"):
|
55 |
+
model_gg = gr.Dropdown(label="Model", value="Gemini-1.5-Flash", choices=["Gemini-1.5-Flash", "Gemini-1.5-Pro"], interactive=False)
|
56 |
+
key_gg = gr.Textbox(label="Google API Key")
|
57 |
+
endpoint_gg = gr.Textbox(label="Azure Endpoint")
|
58 |
+
with gr.Tab("Anthropic"):
|
59 |
+
model_ac = gr.Dropdown(label="Model", value="Claude-3-Opus", choices=["Claude-3-Opus", "Claude-3-Sonnet"], interactive=False)
|
60 |
+
key_ac = gr.Textbox(label="Anthropic API Key")
|
61 |
+
endpoint_ac = gr.Textbox(label="Anthropic Endpoint")
|
62 |
+
with gr.Tab("OpenAI"):
|
63 |
+
model_oai = gr.Dropdown(label="Model", value="GPT-4o", choices=["GPT-4o", "GPT-4v"], interactive=False)
|
64 |
+
key_oai = gr.Textbox(label="OpenAI API Key")
|
65 |
+
endpoint_oai = gr.Textbox(label="OpenAI Endpoint")
|
66 |
with gr.Accordion("Data Source", open=True):
|
67 |
with gr.Tabs():
|
68 |
with gr.Tab("Upload"):
|
69 |
+
video_src = gr.Video(sources="upload", show_label=False, show_share_button=False, mirror_webcam=False)
|
70 |
+
with gr.Tab("HF"):
|
71 |
+
video_hf = gr.Text()
|
72 |
+
with gr.Tab("Onedrive"):
|
73 |
+
video_od = gr.Text()
|
74 |
+
with gr.Tab("Google Drive"):
|
75 |
+
video_gd = gr.Text()
|
76 |
caption_button = gr.Button("Caption", variant="primary", size="lg")
|
77 |
caption_button.click(
|
78 |
process_caption,
|
79 |
+
inputs=[prompt, temp, top_p, max_tokens, model, key, endpoint, video_src, frame_format, frame_skip, group_size],
|
80 |
outputs=[result, info, frame]
|
81 |
)
|
82 |
|
83 |
if __name__ == "__main__":
|
84 |
Core.launch()
|
85 |
+
|