OpceanAI commited on
Commit
44db14a
·
verified ·
1 Parent(s): af01c81

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +163 -7
app.py CHANGED
@@ -1,10 +1,166 @@
1
  import gradio as gr
2
 
3
- with gr.Blocks(fill_height=True) as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  with gr.Sidebar():
5
- gr.Markdown("# Inference Provider")
6
- gr.Markdown("This Space showcases the OpceanAI/Yuuki-RxG model, served by the featherless-ai API. Sign in with your Hugging Face account to use this API.")
7
- button = gr.LoginButton("Sign in")
8
- gr.load("models/OpceanAI/Yuuki-RxG", accept_token=button, provider="featherless-ai")
9
-
10
- demo.launch()
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
 
3
+ custom_css = """
4
+ @import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@300;400;500&display=swap');
5
+
6
+ :root {
7
+ --ink: #0a0a0a;
8
+ --paper: #f5f2ed;
9
+ --accent: #c8a97e;
10
+ --muted: #8a8278;
11
+ --border: #d4cfc8;
12
+ --surface: #ede9e2;
13
+ }
14
+
15
+ * {
16
+ font-family: 'DM Mono', monospace;
17
+ box-sizing: border-box;
18
+ }
19
+
20
+ body, .gradio-container {
21
+ background-color: var(--paper) !important;
22
+ color: var(--ink) !important;
23
+ }
24
+
25
+ .gradio-container {
26
+ max-width: 100% !important;
27
+ }
28
+
29
+ .sidebar {
30
+ background-color: var(--ink) !important;
31
+ border-right: none !important;
32
+ padding: 2.5rem 2rem !important;
33
+ }
34
+
35
+ .sidebar * {
36
+ color: var(--paper) !important;
37
+ }
38
+
39
+ .sidebar h1 {
40
+ font-family: 'DM Serif Display', serif !important;
41
+ font-size: 1.6rem !important;
42
+ letter-spacing: -0.02em !important;
43
+ line-height: 1.2 !important;
44
+ margin-bottom: 1.5rem !important;
45
+ color: var(--accent) !important;
46
+ border-bottom: 1px solid #2a2a2a !important;
47
+ padding-bottom: 1rem !important;
48
+ }
49
+
50
+ .sidebar p {
51
+ font-size: 0.72rem !important;
52
+ line-height: 1.7 !important;
53
+ color: #9a9490 !important;
54
+ letter-spacing: 0.02em !important;
55
+ }
56
+
57
+ button.lg {
58
+ background-color: transparent !important;
59
+ color: var(--accent) !important;
60
+ border: 1px solid var(--accent) !important;
61
+ border-radius: 0 !important;
62
+ font-family: 'DM Mono', monospace !important;
63
+ font-size: 0.7rem !important;
64
+ letter-spacing: 0.12em !important;
65
+ text-transform: uppercase !important;
66
+ padding: 0.7rem 1.4rem !important;
67
+ transition: all 0.2s ease !important;
68
+ margin-top: 1.5rem !important;
69
+ width: 100% !important;
70
+ }
71
+
72
+ button.lg:hover {
73
+ background-color: var(--accent) !important;
74
+ color: var(--ink) !important;
75
+ }
76
+
77
+ .chatbot {
78
+ background-color: var(--paper) !important;
79
+ border: 1px solid var(--border) !important;
80
+ border-radius: 0 !important;
81
+ }
82
+
83
+ .message.user {
84
+ background-color: var(--surface) !important;
85
+ border-radius: 0 !important;
86
+ border-left: 3px solid var(--accent) !important;
87
+ }
88
+
89
+ .message.bot {
90
+ background-color: transparent !important;
91
+ border-radius: 0 !important;
92
+ border-left: 3px solid var(--border) !important;
93
+ }
94
+
95
+ textarea, input[type="text"] {
96
+ background-color: var(--paper) !important;
97
+ border: 1px solid var(--border) !important;
98
+ border-radius: 0 !important;
99
+ color: var(--ink) !important;
100
+ font-family: 'DM Mono', monospace !important;
101
+ font-size: 0.8rem !important;
102
+ }
103
+
104
+ textarea:focus, input[type="text"]:focus {
105
+ border-color: var(--accent) !important;
106
+ box-shadow: none !important;
107
+ outline: none !important;
108
+ }
109
+
110
+ .submit-btn, button[variant="primary"] {
111
+ background-color: var(--ink) !important;
112
+ color: var(--paper) !important;
113
+ border-radius: 0 !important;
114
+ border: none !important;
115
+ font-family: 'DM Mono', monospace !important;
116
+ font-size: 0.7rem !important;
117
+ letter-spacing: 0.1em !important;
118
+ text-transform: uppercase !important;
119
+ transition: background-color 0.2s ease !important;
120
+ }
121
+
122
+ .submit-btn:hover, button[variant="primary"]:hover {
123
+ background-color: var(--accent) !important;
124
+ }
125
+
126
+ label span {
127
+ font-size: 0.65rem !important;
128
+ letter-spacing: 0.1em !important;
129
+ text-transform: uppercase !important;
130
+ color: var(--muted) !important;
131
+ }
132
+
133
+ .block {
134
+ border-radius: 0 !important;
135
+ }
136
+
137
+ footer {
138
+ display: none !important;
139
+ }
140
+ """
141
+
142
+ with gr.Blocks(
143
+ fill_height=True,
144
+ css=custom_css,
145
+ title="Yuuki-RxG",
146
+ theme=gr.themes.Base(
147
+ primary_hue="stone",
148
+ neutral_hue="stone",
149
+ font=gr.themes.GoogleFont("DM Mono"),
150
+ )
151
+ ) as demo:
152
  with gr.Sidebar():
153
+ gr.Markdown("# Yuuki-RxG")
154
+ gr.Markdown(
155
+ "Modelo servido via **featherless-ai**. "
156
+ "Inicia sesión con tu cuenta de Hugging Face para acceder a la inferencia."
157
+ )
158
+ button = gr.LoginButton("Iniciar sesión")
159
+
160
+ gr.load(
161
+ "models/OpceanAI/Yuuki-RxG",
162
+ accept_token=button,
163
+ provider="featherless-ai",
164
+ )
165
+
166
+ demo.launch()