mrbeliever commited on
Commit
2e7a398
1 Parent(s): 9f11ab8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +29 -15
app.py CHANGED
@@ -40,18 +40,32 @@ def generate(prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition
40
  yield output.strip('</s>')
41
  return output.strip('</s>')
42
 
43
- with gr.Blocks(css="""
44
- body {background-color: #121212; color: #ffffff;}
45
- .gradio-container {background-color: #121212; color: #ffffff;}
46
- input, textarea, select, button {background-color: #333333 !important; color: #ffffff !important; border-color: #555555 !important;}
47
- .gradio-container button {background-color: #555555 !important;}
48
- """) as demo:
49
-
50
- with gr.Row():
51
- input_text = gr.Textbox(placeholder="Enter your prompt here...", lines=2, max_lines=2, label="Prompt")
52
- submit_button = gr.Button("Generate")
53
- output_text = gr.Textbox(label="Output", interactive=True, lines=10)
54
-
55
- submit_button.click(fn=generate, inputs=input_text, outputs=output_text)
56
-
57
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  yield output.strip('</s>')
41
  return output.strip('</s>')
42
 
43
+ def dark_theme():
44
+ return """
45
+ body {
46
+ background-color: #121212;
47
+ color: #ffffff;
48
+ }
49
+ .gradio-container {
50
+ background-color: #121212;
51
+ color: #ffffff;
52
+ }
53
+ input, textarea, select {
54
+ background-color: #333333 !important;
55
+ color: #ffffff !important;
56
+ border-color: #555555 !important;
57
+ }
58
+ .gradio-container button {
59
+ background-color: #555555 !important;
60
+ color: #ffffff !important;
61
+ }
62
+ """
63
+
64
+ with gr.Interface(
65
+ fn=generate,
66
+ inputs=gr.Textbox(placeholder="Enter your prompt here...", label="Prompt"),
67
+ outputs=gr.Textbox(label="Output", interactive=True, lines=10),
68
+ theme="compact", # Use compact theme for default layout
69
+ css=dark_theme() # Apply dark theme styles
70
+ ) as app:
71
+ app.launch()