mariusjabami commited on
Commit
7515381
·
verified ·
1 Parent(s): 1345715

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -1,5 +1,6 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
 
3
 
4
  # Cliente da Inference API
5
  client = InferenceClient("lambdaindie/lambdai")
@@ -26,6 +27,10 @@ def respond(
26
 
27
  response = ""
28
 
 
 
 
 
29
  # Fluxo de resposta do cliente da API
30
  for message in client.chat_completion(
31
  messages,
@@ -54,7 +59,7 @@ demo = gr.ChatInterface(
54
  label="Top-p (nucleus sampling)",
55
  ),
56
  ],
57
- title="Lambda Chatbot", # Título na interface
58
  description="Chatbot alimentado pelo modelo Lambdai", # Descrição simples
59
  theme="dark", # Usando o tema Dark do Gradio
60
  )
@@ -106,6 +111,9 @@ demo.css = """
106
  .gr-chatbox .message {
107
  font-family: 'JetBrains Mono', monospace;
108
  }
 
 
 
109
  """
110
 
111
  if __name__ == "__main__":
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
+ import time
4
 
5
  # Cliente da Inference API
6
  client = InferenceClient("lambdaindie/lambdai")
 
27
 
28
  response = ""
29
 
30
+ # Mostrando o indicador de "thinking"
31
+ yield "Thinking... 🤔"
32
+ time.sleep(1) # Atraso artificial para simular tempo de processamento
33
+
34
  # Fluxo de resposta do cliente da API
35
  for message in client.chat_completion(
36
  messages,
 
59
  label="Top-p (nucleus sampling)",
60
  ),
61
  ],
62
+ title="Lambda-v1-1B", # Título na interface
63
  description="Chatbot alimentado pelo modelo Lambdai", # Descrição simples
64
  theme="dark", # Usando o tema Dark do Gradio
65
  )
 
111
  .gr-chatbox .message {
112
  font-family: 'JetBrains Mono', monospace;
113
  }
114
+ .gr-button.gr-loading {
115
+ background-color: #f39c12;
116
+ }
117
  """
118
 
119
  if __name__ == "__main__":