Update app.py
Browse files
app.py
CHANGED
@@ -26,7 +26,7 @@ def process_image_and_display_payload(image):
|
|
26 |
status_message = f"<p style='color:red; font-weight:bold;'>❌ Error: {message}</p>"
|
27 |
payload = {}
|
28 |
|
29 |
-
return status_message, payload, user, user_pass
|
30 |
|
31 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
32 |
gr.Markdown("# Gradio KeyLock Component Demo")
|
@@ -38,8 +38,14 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
38 |
)
|
39 |
with gr.Row():
|
40 |
with gr.Column():
|
|
|
41 |
user_name=gr.Textbox(label='User Name')
|
42 |
user_pass=gr.Textbox(label='Password', type='password')
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
with gr.Column():
|
45 |
keylock_builder = KeylockDecoderComponent(server_logic)
|
@@ -50,7 +56,7 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
|
50 |
image_input.upload(
|
51 |
fn=process_image_and_display_payload,
|
52 |
inputs=image_input,
|
53 |
-
outputs=[status_display, output_json, user_name, user_pass]
|
54 |
)
|
55 |
|
56 |
demo.launch()
|
|
|
26 |
status_message = f"<p style='color:red; font-weight:bold;'>❌ Error: {message}</p>"
|
27 |
payload = {}
|
28 |
|
29 |
+
return status_message, payload, user, user_pass, GROQ_API_KEY, HF_TOKEN, OPENAI_API_KEY, OPENROUTER_API_KEY
|
30 |
|
31 |
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
32 |
gr.Markdown("# Gradio KeyLock Component Demo")
|
|
|
38 |
)
|
39 |
with gr.Row():
|
40 |
with gr.Column():
|
41 |
+
gr.Markdown("## Login")
|
42 |
user_name=gr.Textbox(label='User Name')
|
43 |
user_pass=gr.Textbox(label='Password', type='password')
|
44 |
+
gr.Markdown("## API Keys")
|
45 |
+
user_GROQ=gr.Textbox(label='GROQ_API_KEY', type='password')
|
46 |
+
user_HF=gr.Textbox(label='HF_TOKEN', type='password')
|
47 |
+
user_OPENAI=gr.Textbox(label='OPENAI_API_KEY', type='password')
|
48 |
+
user_OPENROUTER=gr.Textbox(label='OPENROUTER_API_KEY', type='password')
|
49 |
|
50 |
with gr.Column():
|
51 |
keylock_builder = KeylockDecoderComponent(server_logic)
|
|
|
56 |
image_input.upload(
|
57 |
fn=process_image_and_display_payload,
|
58 |
inputs=image_input,
|
59 |
+
outputs=[status_display, output_json, user_name, user_pass, GROQ_API_KEY, HF_TOKEN, OPENAI_API_KEY, OPENROUTER_API_KEY]
|
60 |
)
|
61 |
|
62 |
demo.launch()
|