fffiloni commited on
Commit
b9bed89
1 Parent(s): 540056e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -9
app.py CHANGED
@@ -53,12 +53,43 @@ def infer(image_in):
53
 
54
  return cleaned_text
55
 
56
- gr.Interface(
57
- fn = infer,
58
- inputs = [
59
- gr.Image(type="filepath")
60
- ],
61
- outputs = [
62
- gr.Textbox()
63
- ]
64
- ).queue().launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  return cleaned_text
55
 
56
+ title = "LLM Agent from a Picture",
57
+ description = "Get a LLM system prompt from a picture to then use in GPT-Baker."
58
+
59
+ css = """
60
+ #col-container{
61
+ margin: 0 auto;
62
+ max-width: 840px;
63
+ text-align: left;
64
+ }
65
+ """
66
+
67
+ with gr.Blocks(css=css) as demo:
68
+ with gr.Column(elem_id="col-container"):
69
+ gr.HTML(f"""
70
+ <h2 style="text-align: center;">{title}</h2>
71
+ <p style="text-align: center;">{description}</p>
72
+ """)
73
+ with gr.Row():
74
+ with gr.Column():
75
+ image_in = gr.Image(
76
+ label = "Image reference",
77
+ type = "filepath"
78
+ )
79
+ submit_btn = gr.Button("Make LLM system from my pic !")
80
+ with gr.Column():
81
+ result = gr.Textbox(
82
+ label ="Suggested System"
83
+ )
84
+
85
+ submit_btn.click(
86
+ fn = infer,
87
+ inputs = [
88
+ image_in
89
+ ],
90
+ outputs =[
91
+ result
92
+ ]
93
+ )
94
+
95
+ demo.queue().launch()