Spaces:
Runtime error
Runtime error
Commit
·
6300de6
1
Parent(s):
dfe7100
Correção CSS (#11)
Browse files- Correção CSS (8b5db7b38c19ca242c819fd3b873379c955333b6)
Co-authored-by: Renato Cardoso Zimmer <[email protected]>
app.py
CHANGED
@@ -13,8 +13,13 @@ p = pipeline("automatic-speech-recognition")
|
|
13 |
os.environ["OPENAI_API_KEY"] = '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'
|
14 |
|
15 |
css = """
|
|
|
|
|
|
|
|
|
16 |
#component-2 {position: absolute; bottom: 0; width: 100%;
|
17 |
}
|
|
|
18 |
div.float.svelte-1frtwj3 {
|
19 |
position: absolute;
|
20 |
opacity: 0;
|
@@ -25,11 +30,8 @@ div.float.svelte-1frtwj3 {
|
|
25 |
height: 100%;
|
26 |
max-height: 100%;
|
27 |
overflow-y: auto;
|
28 |
-
}
|
29 |
-
.bot.svelte-6roggh.svelte-6roggh, .pending.svelte-6roggh.svelte-6roggh {
|
30 |
-
border-color: ##D9A13D;
|
31 |
-
background: ##D9A13D;
|
32 |
}
|
|
|
33 |
div.svelte-1frtwj3 {
|
34 |
display: inline-flex;
|
35 |
align-items: center;
|
@@ -50,30 +52,77 @@ div.svelte-1frtwj3 {
|
|
50 |
|
51 |
div.bot.svelte-6roggh.svelte-6roggh {
|
52 |
background: #D9A13D;
|
53 |
-
|
|
|
|
|
|
|
|
|
54 |
|
55 |
div.user.svelte-6roggh.svelte-6roggh {
|
56 |
background: #5F0000;
|
57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
-
|
60 |
display: flex;
|
61 |
flex-direction: inherit;
|
62 |
flex-wrap: wrap;
|
63 |
gap: var(--form-gap-width);
|
64 |
box-shadow: var(--block-shadow);
|
65 |
-
border: var(--block-border-width) solid
|
66 |
border-radius: var(--radius-lg);
|
67 |
-
background:
|
68 |
overflow: hidden;
|
69 |
position: fixed;
|
70 |
bottom: 0;
|
71 |
margin-left: -16px;
|
72 |
}
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
77 |
}
|
78 |
.app.svelte-ac4rv4.svelte-ac4rv4 {
|
79 |
max-width: none;
|
@@ -81,6 +130,7 @@ img.svelte-ms5bsk {
|
|
81 |
}
|
82 |
.app.svelte-ac4rv4.svelte-ac4rv4{max-width:none}
|
83 |
.wrap.svelte-1o68geq.svelte-1o68geq {max-height: none}
|
|
|
84 |
.block.svelte-mppz8v {
|
85 |
position: relative;
|
86 |
margin: 0;
|
@@ -128,11 +178,11 @@ def chatbot(input_text):
|
|
128 |
return str(response.response)
|
129 |
|
130 |
|
131 |
-
with gr.Blocks(css=css
|
132 |
realPath = str(os.path.dirname(os.path.realpath(__file__)))
|
133 |
-
img1 = gr.Image("images/
|
134 |
-
gpt = gr.Chatbot(
|
135 |
-
msg = gr.Textbox(elem_id="div.svelte-awbtu4",elem_classes="
|
136 |
placeholder="Bem vindo ao Hippo Supermercados, em que posso ajuda-lo?",
|
137 |
).style(container=False)
|
138 |
#clear = gr.Button("Limpar Conversa")
|
|
|
13 |
os.environ["OPENAI_API_KEY"] = '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'
|
14 |
|
15 |
css = """
|
16 |
+
.gradio-container {
|
17 |
+
background-color: #ffffff;
|
18 |
+
}
|
19 |
+
|
20 |
#component-2 {position: absolute; bottom: 0; width: 100%;
|
21 |
}
|
22 |
+
|
23 |
div.float.svelte-1frtwj3 {
|
24 |
position: absolute;
|
25 |
opacity: 0;
|
|
|
30 |
height: 100%;
|
31 |
max-height: 100%;
|
32 |
overflow-y: auto;
|
|
|
|
|
|
|
|
|
33 |
}
|
34 |
+
|
35 |
div.svelte-1frtwj3 {
|
36 |
display: inline-flex;
|
37 |
align-items: center;
|
|
|
52 |
|
53 |
div.bot.svelte-6roggh.svelte-6roggh {
|
54 |
background: #D9A13D;
|
55 |
+
}
|
56 |
+
|
57 |
+
div.bot.svelte-17nzccn.svelte-17nzccn {
|
58 |
+
background: #D9A13D;
|
59 |
+
}
|
60 |
|
61 |
div.user.svelte-6roggh.svelte-6roggh {
|
62 |
background: #5F0000;
|
63 |
+
}
|
64 |
+
|
65 |
+
div.user.svelte-17nzccn.svelte-17nzccn {
|
66 |
+
background: #5F0000;
|
67 |
+
}
|
68 |
+
|
69 |
+
div.textBoxBot {
|
70 |
+
display: flex;
|
71 |
+
flex-direction: inherit;
|
72 |
+
flex-wrap: wrap;
|
73 |
+
gap: var(--form-gap-width);
|
74 |
+
box-shadow: var(--block-shadow);
|
75 |
+
border: var(--block-border-width) solid #5f0000;
|
76 |
+
border-radius: var(--radius-lg);
|
77 |
+
background: #ffffff;
|
78 |
+
overflow: hidden;
|
79 |
+
position: fixed;
|
80 |
+
bottom: 0;
|
81 |
+
margin-left: -16px;
|
82 |
+
}
|
83 |
|
84 |
+
.textarea.svelte-1pie7s6.svelte-1pie7s6 {
|
85 |
display: flex;
|
86 |
flex-direction: inherit;
|
87 |
flex-wrap: wrap;
|
88 |
gap: var(--form-gap-width);
|
89 |
box-shadow: var(--block-shadow);
|
90 |
+
border: var(--block-border-width) solid #5f0000;
|
91 |
border-radius: var(--radius-lg);
|
92 |
+
background: #ffffff;
|
93 |
overflow: hidden;
|
94 |
position: fixed;
|
95 |
bottom: 0;
|
96 |
margin-left: -16px;
|
97 |
}
|
98 |
+
|
99 |
+
.svelte-1pie7s6.svelte-1pie7s6 {
|
100 |
+
display: flex;
|
101 |
+
flex-direction: inherit;
|
102 |
+
flex-wrap: wrap;
|
103 |
+
gap: var(--form-gap-width);
|
104 |
+
box-shadow: var(--block-shadow);
|
105 |
+
border: 5px solid #5f0000;
|
106 |
+
border-radius: var(--radius-lg);
|
107 |
+
border-color: #5F0000;
|
108 |
+
background: #ffffff;
|
109 |
+
color: #5F0000;
|
110 |
+
font-size: 16px;
|
111 |
+
overflow: hidden;
|
112 |
+
position: fixed;
|
113 |
+
bottom: 20px; /* Ajuste a distância vertical do rodapé */
|
114 |
+
margin-left: -5px;
|
115 |
+
max-height: 80vh; /* Ajuste a altura máxima da div */
|
116 |
+
max-width: 78%; /* Ajuste a largura máxima da div */
|
117 |
+
}
|
118 |
+
|
119 |
+
|
120 |
+
.img.svelte-ms5bsk {
|
121 |
+
width: 100%;
|
122 |
+
height: 100%;
|
123 |
+
background-color: #ffffff;
|
124 |
+
border: 0px;
|
125 |
+
border-width: 0px;
|
126 |
}
|
127 |
.app.svelte-ac4rv4.svelte-ac4rv4 {
|
128 |
max-width: none;
|
|
|
130 |
}
|
131 |
.app.svelte-ac4rv4.svelte-ac4rv4{max-width:none}
|
132 |
.wrap.svelte-1o68geq.svelte-1o68geq {max-height: none}
|
133 |
+
|
134 |
.block.svelte-mppz8v {
|
135 |
position: relative;
|
136 |
margin: 0;
|
|
|
178 |
return str(response.response)
|
179 |
|
180 |
|
181 |
+
with gr.Blocks(css=css) as demo:
|
182 |
realPath = str(os.path.dirname(os.path.realpath(__file__)))
|
183 |
+
img1 = gr.Image("images/1024x150_cabeçalho.hippo.png", elem_classes=".img.svelte-ms5bsk", elem_id="img.svelte-ms5bsk").style(container=False)
|
184 |
+
gpt = gr.Chatbot(elem_classes=".wrap.svelte-1o68geq.svelte-1o68geq", elem_id="chatbot").style(container=True)
|
185 |
+
msg = gr.Textbox(elem_id="div.svelte-awbtu4",elem_classes="textBoxBot", show_label=False,
|
186 |
placeholder="Bem vindo ao Hippo Supermercados, em que posso ajuda-lo?",
|
187 |
).style(container=False)
|
188 |
#clear = gr.Button("Limpar Conversa")
|