brurei commited on
Commit
0b5be0e
1 Parent(s): 68d05ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +56 -3
app.py CHANGED
@@ -12,6 +12,58 @@ p = pipeline("automatic-speech-recognition")
12
 
13
  os.environ["OPENAI_API_KEY"] = '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'
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  md = """This is some code:
16
 
17
  hello
@@ -48,9 +100,10 @@ def chatbot(input_text):
48
  return str(response.response)
49
 
50
 
51
- with gr.Blocks() as demo:
52
- gpt = gr.Chatbot(label="Zoh", elem_id="chatbot")
53
- msg = gr.Textbox( show_label=False,
 
54
  placeholder="Bem vindo ao Hippo Supermercados, em que posso ajuda-lo?",
55
  ).style(container=False)
56
  clear = gr.Button("Limpar Conversa")
 
12
 
13
  os.environ["OPENAI_API_KEY"] = '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'
14
 
15
+ css = """
16
+ #component-2 {position: absolute; bottom: 0; width: 100%;
17
+ }
18
+ .wrap.svelte-6roggh.svelte-6roggh {
19
+ padding: var(--block-padding);
20
+ height: 100%;
21
+ max-height: 100%;
22
+ overflow-y: auto;
23
+ }
24
+ .bot.svelte-6roggh.svelte-6roggh, .pending.svelte-6roggh.svelte-6roggh {
25
+ border-color: #759ce9;
26
+ background: #ffffff;
27
+ }
28
+ div.svelte-1frtwj3 {
29
+ display: inline-flex;
30
+ align-items: center;
31
+ z-index: var(--layer-2);
32
+ box-shadow: var(--block-shadow);
33
+ border: var(--block-label-border-width) solid #ffffff;
34
+ border-top: none;
35
+ border-left: none;
36
+ border-radius: var(--block-label-radius);
37
+ background: #eff6ff;
38
+ padding: var(--block-label-padding);
39
+ pointer-events: none;
40
+ color: var(--block-label-text-color);
41
+ font-weight: var(--block-label-text-weight);
42
+ width: 100%;
43
+ line-height: var(--line-sm);
44
+ }
45
+ div.svelte-awbtu4 {
46
+ display: flex;
47
+ flex-direction: inherit;
48
+ flex-wrap: wrap;
49
+ gap: var(--form-gap-width);
50
+ box-shadow: var(--block-shadow);
51
+ border: var(--block-border-width) solid var(--border-color-primary);
52
+ border-radius: var(--radius-lg);
53
+ background: var(--border-color-primary);
54
+ overflow: hidden;
55
+ position: fixed;
56
+ bottom: 0;
57
+ margin-left: -16px;
58
+ }
59
+ .app.svelte-ac4rv4.svelte-ac4rv4 {
60
+ max-width: none;
61
+ background-color: #dbeafe;
62
+ }
63
+ .app.svelte-ac4rv4.svelte-ac4rv4{max-width:none}
64
+ .wrap.svelte-1o68geq.svelte-1o68geq {max-height: none}
65
+ """
66
+
67
  md = """This is some code:
68
 
69
  hello
 
100
  return str(response.response)
101
 
102
 
103
+ with gr.Blocks(css=css, elem_classes=".app.svelte-ac4rv4.svelte-ac4rv4") as demo:
104
+ realPath = str(os.path.dirname(os.path.realpath(__file__)))
105
+ gpt = gr.Chatbot(label="Converse com a Zoh",elem_classes=".wrap.svelte-1o68geq.svelte-1o68geq", elem_id="chatbot").style(container=True)
106
+ msg = gr.Textbox(elem_id="div.svelte-awbtu4",elem_classes="div.svelte-awbtu4", show_label=False,
107
  placeholder="Bem vindo ao Hippo Supermercados, em que posso ajuda-lo?",
108
  ).style(container=False)
109
  clear = gr.Button("Limpar Conversa")