lucianosb commited on
Commit
58517d3
1 Parent(s): f38962f

Atualiza para usar o boto

Browse files
Files changed (1) hide show
  1. app.py +20 -21
app.py CHANGED
@@ -10,16 +10,16 @@ import gradio as gr
10
  from huggingface_hub import hf_hub_download
11
 
12
  hf_hub_download(
13
- repo_id="bartowski/gemma-2-9b-it-GGUF",
14
- filename="gemma-2-9b-it-Q5_K_M.gguf",
15
  local_dir="./models"
16
  )
17
 
18
 
19
 
20
  hf_hub_download(
21
- repo_id="bartowski/gemma-2-27b-it-GGUF",
22
- filename="gemma-2-27b-it-Q5_K_M.gguf",
23
  local_dir="./models"
24
  )
25
 
@@ -98,27 +98,24 @@ def respond(
98
  outputs += output
99
  yield outputs
100
 
101
- description = """<p align="center">Defaults to 27B it (you can switch to 9b it from additional inputs)</p>
102
- <p><center>
103
- <a href="https://huggingface.co/google/gemma-2-27b-it" target="_blank">[27B it Model]</a>
104
- <a href="https://huggingface.co/google/gemma-2-9b-it" target="_blank">[9B it Model]</a>
105
- <a href="https://huggingface.co/bartowski/gemma-2-27b-it-GGUF" target="_blank">[27B it Model GGUF]</a>
106
- <a href="https://huggingface.co/bartowski/gemma-2-9b-it-GGUF" target="_blank">[9B it Model GGUF]</a>
107
- </center></p>
108
  """
109
 
110
  demo = gr.ChatInterface(
111
  respond,
 
112
  additional_inputs=[
113
  gr.Dropdown([
114
- 'gemma-2-9b-it-Q5_K_M.gguf',
115
- 'gemma-2-27b-it-Q5_K_M.gguf'
116
  ],
117
- value="gemma-2-27b-it-Q5_K_M.gguf",
118
  label="Model"
119
  ),
120
- gr.Textbox(value="You are a helpful assistant.", label="System message"),
121
- gr.Slider(minimum=1, maximum=4096, value=2048, step=1, label="Max tokens"),
122
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
123
  gr.Slider(
124
  minimum=0.1,
@@ -142,17 +139,19 @@ demo = gr.ChatInterface(
142
  label="Repetition penalty",
143
  ),
144
  ],
145
- retry_btn="Retry",
146
- undo_btn="Undo",
147
- clear_btn="Clear",
148
- submit_btn="Send",
149
- title="Chat with Gemma 2 using llama.cpp",
 
150
  description=description,
151
  chatbot=gr.Chatbot(
152
  scale=1,
153
  likeable=False,
154
  show_copy_button=True
155
  )
 
156
  )
157
 
158
  if __name__ == "__main__":
 
10
  from huggingface_hub import hf_hub_download
11
 
12
  hf_hub_download(
13
+ repo_id="lucianosb/boto-9B-GGUF",
14
+ filename="boto9b.Q4_0.gguf",
15
  local_dir="./models"
16
  )
17
 
18
 
19
 
20
  hf_hub_download(
21
+ repo_id="lucianosb/boto-9B-GGUF",
22
+ filename="boto9b.Q5_K_M.gguf",
23
  local_dir="./models"
24
  )
25
 
 
98
  outputs += output
99
  yield outputs
100
 
101
+ description = """[lucianosb/boto-9B](https://huggingface.co/lucianosb/boto-9B) é um fine-tune de Gemma2-9B para língua portuguesa.
102
+
103
+ Boto responde bem a instruções. Não foi treinado para chat.
 
 
 
 
104
  """
105
 
106
  demo = gr.ChatInterface(
107
  respond,
108
+ additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False),
109
  additional_inputs=[
110
  gr.Dropdown([
111
+ 'boto9b.Q4_0.gguf',
112
+ 'boto9b.Q5_K_M.gguf'
113
  ],
114
+ value="boto9b.Q5_K_M.gguf",
115
  label="Model"
116
  ),
117
+ gr.Textbox(value="Abaixo está uma instrução que descreve uma tarefa. Escreva uma resposta que complete adequadamente a solicitação. Seja conciso e direto. Não forneça muitas explicações.", label="System message"),
118
+ gr.Slider(minimum=1, maximum=8192, value=2048, step=1, label="Max tokens"),
119
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
120
  gr.Slider(
121
  minimum=0.1,
 
139
  label="Repetition penalty",
140
  ),
141
  ],
142
+ retry_btn="🔄 De Novo",
143
+ undo_btn="↩️ Desfazer",
144
+ clear_btn="🗑️ Limpar",
145
+ submit_btn="Enviar",
146
+ stop_btn="Parar",
147
+ title="🐬🩷 Chat com o Boto 9B",
148
  description=description,
149
  chatbot=gr.Chatbot(
150
  scale=1,
151
  likeable=False,
152
  show_copy_button=True
153
  )
154
+ theme=gr.themes.Soft(primary_hue="pink"),
155
  )
156
 
157
  if __name__ == "__main__":