brurei commited on
Commit
3b8f6c9
1 Parent(s): 8f88737

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +31 -6
app.py CHANGED
@@ -12,6 +12,31 @@ 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,13 +73,13 @@ def chatbot(input_text):
48
  return str(response.response)
49
 
50
 
51
- with gr.Blocks() as demo:
52
- gpt = gr.Chatbot(label="GPT SUPEr", elem_id="chatbot")
53
- msg = gr.Textbox( show_label=False,
54
  placeholder="Bem vindo ao ExpoSuper, Qual sua pergunta?",
55
  ).style(container=False)
56
- clear = gr.Button("Limpar Conversa")
57
- gr.Audio(source="microphone", type="filepath",label="ESTÁ COM DIFICULDADES EM ESCREVER? CLIQUE E ME DIGA O QUE DESEJA")
58
  def respond(message, chat_history):
59
  chat_history.append((message, chatbot(message)))
60
  time.sleep(1)
@@ -359,7 +384,7 @@ with gr.Blocks() as demo:
359
 
360
  return "", chat_history+vetor
361
 
362
- clear.click(lambda:None, None, gpt, queue=False,)
363
  msg.submit(respond, [msg, gpt], [msg,gpt])
364
 
365
  index = construct_index("docs")
 
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
+ div.svelte-awbtu4 {
19
+ display: flex;
20
+ flex-direction: inherit;
21
+ flex-wrap: wrap;
22
+ gap: var(--form-gap-width);
23
+ box-shadow: var(--block-shadow);
24
+ border: var(--block-border-width) solid var(--border-color-primary);
25
+ border-radius: var(--radius-lg);
26
+ background: var(--border-color-primary);
27
+ overflow: hidden;
28
+ position: fixed;
29
+ bottom: 0;
30
+ margin-left: -16px;
31
+ }
32
+ .app.svelte-ac4rv4.svelte-ac4rv4 {
33
+ max-width: none;
34
+ background-color: #dbeafe;
35
+ }
36
+ .app.svelte-ac4rv4.svelte-ac4rv4{max-width:none}
37
+ .wrap.svelte-1o68geq.svelte-1o68geq {max-height: none}
38
+ """
39
+
40
  md = """This is some code:
41
 
42
  hello
 
73
  return str(response.response)
74
 
75
 
76
+ with gr.Blocks(css=css, elem_classes=".app.svelte-ac4rv4.svelte-ac4rv4") as demo:
77
+ gpt = gr.Chatbot(label="GPT SUPEr",elem_classes=".wrap.svelte-1o68geq.svelte-1o68geq", elem_id="chatbot").style(container=True)
78
+ msg = gr.Textbox(elem_id="div.svelte-awbtu4",elem_classes="div.svelte-awbtu4", show_label=False,
79
  placeholder="Bem vindo ao ExpoSuper, Qual sua pergunta?",
80
  ).style(container=False)
81
+ # clear = gr.Button("Limpar Conversa")
82
+ # gr.Audio(source="microphone", type="filepath",label="ESTÁ COM DIFICULDADES EM ESCREVER? CLIQUE E ME DIGA O QUE DESEJA")
83
  def respond(message, chat_history):
84
  chat_history.append((message, chatbot(message)))
85
  time.sleep(1)
 
384
 
385
  return "", chat_history+vetor
386
 
387
+ # clear.click(lambda:None, None, gpt, queue=False,)
388
  msg.submit(respond, [msg, gpt], [msg,gpt])
389
 
390
  index = construct_index("docs")