Loewolf commited on
Commit
6c78411
1 Parent(s): 146a36e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +33 -25
app.py CHANGED
@@ -35,34 +35,42 @@ DESCRIPTION = """\
35
  #Löwolf GPT1 Chat
36
  """
37
  css = """
38
- h1 {
39
- text-align: center;
40
- }
41
-
42
- #duplicate-button {
43
- margin: auto;
44
- color: white;
45
- background: #1565c0;
46
- border-radius: 100vh;
47
- }
48
-
49
- .contain {
50
- max-width: 900px;
51
- margin: auto;
52
- padding-top: 1.5rem;
53
- }
54
-
55
  """
56
 
57
- iface = gr.Interface(
58
- fn=generate_text,
59
-
60
- outputs=gr.Textbox(label="Löwolf Chat Responses", placeholder="Responses will appear here...", interactive=False, lines=10),
61
- inputs=gr.Textbox(lines=2, placeholder="Type a message...", label="Your Message"),
62
- css=css
63
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
- iface.launch()
66
 
67
 
68
 
 
35
  #Löwolf GPT1 Chat
36
  """
37
  css = """
38
+ body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; }
39
+ .gradio_app { display: flex; flex-direction: column-reverse; max-width: 800px; margin: auto; }
40
+ .gradio_interface { box-shadow: 0 0 20px rgba(0,0,0,0.1); }
41
+ .gradio_text_input { border-radius: 20px; }
42
+ .gradio_text_output { height: calc(100vh - 150px); border-radius: 20px; overflow-y: auto; }
43
+ button { border-radius: 20px; }
44
+ #input-box { order: 2; }
45
+ #output-box { order: 1; }
46
+ #input { height: 50px; }
47
+ #output { height: calc(100vh - 150px); }
 
 
 
 
 
 
 
48
  """
49
 
50
+ # Update the Blocks structure to reflect the desired layout
51
+ with gr.Blocks(css=css) as demo:
52
+ gr.Markdown(DESCRIPTION)
53
+ gr.Markdown(LICENSE)
54
+ gr.DuplicateButton(value="Duplicate Space for private use", elem_id="duplicate-button")
55
+ with gr.Row().style(equal_height=False):
56
+ output_box = gr.Textbox(interactive=False, lines=25, placeholder="Responses will appear here...", elem_id="output-box")
57
+ input_box = gr.Textbox(lines=1, placeholder="Type a message...", elem_id="input-box")
58
+ generate_button = gr.Button("Submit")
59
+ generate_button.click(
60
+ fn=generate,
61
+ inputs=[input_box],
62
+ outputs=output_box
63
+ )
64
+
65
+ if __name__ == "__main__":
66
+ demo.queue(max_size=20).launch()
67
+
68
+
69
+
70
+
71
+
72
+
73
 
 
74
 
75
 
76