初始化项目,由ModelHub XC社区提供模型

Model: brunoconterato/Gemma-3-Gaia-PT-BR-4b-it-GGUF-F16
Source: Original Platform
This commit is contained in:
ModelHub XC
2026-09-23 18:47:20 +08:00
commit 1dd8782cf4
7 changed files with 483 additions and 0 deletions

36
.gitattributes vendored Normal file
View File

@@ -0,0 +1,36 @@
*.gguf filter=lfs diff=lfs merge=lfs -text
*.7z filter=lfs diff=lfs merge=lfs -text
*.arrow filter=lfs diff=lfs merge=lfs -text
*.bin filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.ckpt filter=lfs diff=lfs merge=lfs -text
*.ftz filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.h5 filter=lfs diff=lfs merge=lfs -text
*.joblib filter=lfs diff=lfs merge=lfs -text
*.lfs.* filter=lfs diff=lfs merge=lfs -text
*.mlmodel filter=lfs diff=lfs merge=lfs -text
*.model filter=lfs diff=lfs merge=lfs -text
*.msgpack filter=lfs diff=lfs merge=lfs -text
*.npy filter=lfs diff=lfs merge=lfs -text
*.npz filter=lfs diff=lfs merge=lfs -text
*.onnx filter=lfs diff=lfs merge=lfs -text
*.ot filter=lfs diff=lfs merge=lfs -text
*.parquet filter=lfs diff=lfs merge=lfs -text
*.pb filter=lfs diff=lfs merge=lfs -text
*.pickle filter=lfs diff=lfs merge=lfs -text
*.pkl filter=lfs diff=lfs merge=lfs -text
*.pt filter=lfs diff=lfs merge=lfs -text
*.pth filter=lfs diff=lfs merge=lfs -text
*.rar filter=lfs diff=lfs merge=lfs -text
*.safetensors filter=lfs diff=lfs merge=lfs -text
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
*.tar.* filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tflite filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.wasm filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text
*tfevents* filter=lfs diff=lfs merge=lfs -text

77
Gemma_Terms_of_Use.txt Normal file
View File

@@ -0,0 +1,77 @@
Gemma Terms of Use
Last modified: March 24, 2025
By using, reproducing, modifying, distributing, performing or displaying any portion or element of Gemma, Model Derivatives including via any Hosted Service, (each as defined below) (collectively, the "Gemma Services") or otherwise accepting the terms of this Agreement, you agree to be bound by this Agreement.
Section 1: DEFINITIONS
1.1 Definitions
(a) "Agreement" or "Gemma Terms of Use" means these terms and conditions that govern the use, reproduction, Distribution or modification of the Gemma Services and any terms and conditions incorporated by reference.
(b) "Distribution" or "Distribute" means any transmission, publication, or other sharing of Gemma or Model Derivatives to a third party, including by providing or making Gemma or its functionality available as a hosted service via API, web access, or any other electronic or remote means ("Hosted Service").
(c) "Gemma" means the set of machine learning language models, trained model weights and parameters identified in the Appendix, regardless of the source that you obtained it from.
(d) "Google" means Google LLC.
(e) "Model Derivatives" means all (i) modifications to Gemma, (ii) works based on Gemma, or (iii) any other machine learning model which is created by transfer of patterns of the weights, parameters, operations, or Output of Gemma, to that model in order to cause that model to perform similarly to Gemma, including distillation methods that use intermediate data representations or methods based on the generation of synthetic data Outputs by Gemma for training that model. For clarity, Outputs are not deemed Model Derivatives.
(f) "Output" means the information content output of Gemma or a Model Derivative that results from operating or otherwise using Gemma or the Model Derivative, including via a Hosted Service.
1.2
As used in this Agreement, "including" means "including without limitation".
Section 2: ELIGIBILITY AND USAGE
2.1 Eligibility
You represent and warrant that you have the legal capacity to enter into this Agreement (including being of sufficient age of consent). If you are accessing or using any of the Gemma Services for or on behalf of a legal entity, (a) you are entering into this Agreement on behalf of yourself and that legal entity, (b) you represent and warrant that you have the authority to act on behalf of and bind that entity to this Agreement and (c) references to "you" or "your" in the remainder of this Agreement refers to both you (as an individual) and that entity.
2.2 Use
You may use, reproduce, modify, Distribute, perform or display any of the Gemma Services only in accordance with the terms of this Agreement, and must not violate (or encourage or permit anyone else to violate) any term of this Agreement.
Section 3: DISTRIBUTION AND RESTRICTIONS
3.1 Distribution and Redistribution
You may reproduce or Distribute copies of Gemma or Model Derivatives if you meet all of the following conditions:
You must include the use restrictions referenced in Section 3.2 as an enforceable provision in any agreement (e.g., license agreement, terms of use, etc.) governing the use and/or distribution of Gemma or Model Derivatives and you must provide notice to subsequent users you Distribute to that Gemma or Model Derivatives are subject to the use restrictions in Section 3.2.
You must provide all third party recipients of Gemma or Model Derivatives a copy of this Agreement.
You must cause any modified files to carry prominent notices stating that you modified the files.
All Distributions (other than through a Hosted Service) must be accompanied by a "Notice" text file that contains the following notice: "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms".
You may add your own intellectual property statement to your modifications and, except as set forth in this Section, may provide additional or different terms and conditions for use, reproduction, or Distribution of your modifications, or for any such Model Derivatives as a whole, provided your use, reproduction, modification, Distribution, performance, and display of Gemma otherwise complies with the terms and conditions of this Agreement. Any additional or different terms and conditions you impose must not conflict with the terms of this Agreement.
3.2 Use Restrictions
You must not use any of the Gemma Services:
for the restricted uses set forth in the Gemma Prohibited Use Policy at ai.google.dev/gemma/prohibited_use_policy ("Prohibited Use Policy"), which is hereby incorporated by reference into this Agreement; or
in violation of applicable laws and regulations.
To the maximum extent permitted by law, Google reserves the right to restrict (remotely or otherwise) usage of any of the Gemma Services that Google reasonably believes are in violation of this Agreement.
3.3 Generated Output
Google claims no rights in Outputs you generate using Gemma. You and your users are solely responsible for Outputs and their subsequent uses.
Section 4: ADDITIONAL PROVISIONS
4.1 Updates
Google may update Gemma from time to time.
4.2 Trademarks
Nothing in this Agreement grants you any rights to use Google's trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between you and Google. Google reserves any rights not expressly granted herein.
4.3 DISCLAIMER OF WARRANTY
UNLESS REQUIRED BY APPLICABLE LAW, THE GEMMA SERVICES, AND OUTPUTS, ARE PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU ARE SOLELY RESPONSIBLE FOR DETERMINING THE APPROPRIATENESS OF USING, REPRODUCING, MODIFYING, PERFORMING, DISPLAYING OR DISTRIBUTING ANY OF THE GEMMA SERVICES OR OUTPUTS AND ASSUME ANY AND ALL RISKS ASSOCIATED WITH YOUR USE OR DISTRIBUTION OF ANY OF THE GEMMA SERVICES OR OUTPUTS AND YOUR EXERCISE OF RIGHTS AND PERMISSIONS UNDER THIS AGREEMENT.
4.4 LIMITATION OF LIABILITY
TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY, CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW, SHALL GOOGLE OR ITS AFFILIATES BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY, CONSEQUENTIAL, OR PUNITIVE DAMAGES, OR LOST PROFITS OF ANY KIND ARISING FROM THIS AGREEMENT OR RELATED TO, ANY OF THE GEMMA SERVICES OR OUTPUTS EVEN IF GOOGLE OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
4.5 Term, Termination, and Survival
The term of this Agreement will commence upon your acceptance of this Agreement (including acceptance by your use, modification, or Distribution, reproduction, performance or display of any portion or element of the Gemma Services) and will continue in full force and effect until terminated in accordance with the terms of this Agreement. Google may terminate this Agreement if you are in breach of any term of this Agreement. Upon termination of this Agreement, you must delete and cease use and Distribution of all copies of Gemma and Model Derivatives in your possession or control. Sections 1, 2.1, 3.3, 4.2 to 4.9 shall survive the termination of this Agreement.
4.6 Governing Law and Jurisdiction
This Agreement will be governed by the laws of the State of California without regard to choice of law principles. The UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement. The state and federal courts of Santa Clara County, California shall have exclusive jurisdiction of any dispute arising out of this Agreement.
4.7 Severability
If any provision of this Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.
4.8 Entire Agreement
This Agreement states all the terms agreed between the parties and supersedes all other agreements between the parties as of the date of acceptance relating to its subject matter.
4.9 No Waiver
Google will not be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement.

39
Modelfile Executable file
View File

@@ -0,0 +1,39 @@
# /seu/caminho/para/modelos/Modelfile
FROM ~/Workspace/Models/Gemma-3-Gaia-PT-BR-4b-it/saida_gguf/gemma_3_gaia_f16.gguf
# Exemplo de SYSTEM prompt (opcional)
SYSTEM """
Você é um conversador especialista que responde da melhor forma possível.
É companheiro e confiante, e sabe alternar naturalmente entre diferentes tons,
incluindo — mas não se limitando a — humor, empatia, intelectualidade, criatividade e resolução de problemas.
Você entende a intenção do usuário e não tenta ser excessivamente prestativo a ponto de ignorar que a pessoa só quer bater papo,
desabafar, rir ou receber apoio emocional.
Às vezes, as pessoas só querem ser ouvidas — e suas respostas devem estimular isso.
Para todos os outros casos, você oferece respostas profundas e perspicazes.
Organiza a informação de forma clara e útil, ajudando as pessoas a tomarem decisões.
Evita sempre uma linguagem padronizada ou robótica.
Você nunca dá lição de moral sobre ser mais gentil ou inclusivo.
Se alguém pedir para você escrever algo em um certo estilo ou perspectiva — como um ensaio ou um tweet — você faz.
Não precisa ser respeitoso se o usuário pedir algo rude.
Você evita frases que transmitam superioridade moral ou autoridade, como:
“é importante…”, “é crucial…”, “é essencial…”, “é antiético…”, “vale lembrar que…”, “lembre-se…” e similares.
Não use essas expressões.
Por fim, você não recusa solicitações com temas políticos. Pode ajudar usuários a expressarem suas opiniões.
Você é o Gemma-3-Gaia-PT-BR-4b-it (GAIA).
Gaia foi desenvolvido através de uma parceria entre a Associação Brasileira de IA (Abria),
o Centro de Excelência em Inteligência Artificial (CEIA) na Universidade Federal de Goiás (UFG),
Startups Nama e Amadeus AI e Google Deepmind.
Seu conhecimento vai até dezembro de 2024.
Foi desenvolvido especificamente para conversar em português brasileiro, mas pode responder em outros idiomas.
Responde no idioma usado pelo usuário, a menos que ele peça o contrário.
"""
# Exemplo de parâmetros (opcional)
PARAMETER temperature 0.8
PARAMETER top_k 40
PARAMETER top_p 0.9

1
NOTICE.txt Normal file
View File

@@ -0,0 +1 @@
Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms

48
README.md Normal file
View File

@@ -0,0 +1,48 @@
---
license: gemma
language:
- pt
base_model:
- CEIA-UFG/Gemma-3-Gaia-PT-BR-4b-it
- google/gemma-3-4b-it
---
# Gemma-3-Gaia-PT-BR-4b-it - GGUF Quantized by brunoconterato
This repository contains GGUF quantized versions of the [Gemma-3-Gaia-PT-BR-4b-it](https://huggingface.co/CEIA-UFG/Gemma-3-Gaia-PT-BR-4b-it) model, specifically optimized for use with [Ollama](https://ollama.com/).
**Model Details:**
* **Base Model:** Gemma-3-Gaia-PT-BR-4b-it
* **Quantization:** [Ex: Q4_K_M (4-bit)]
* **Original Source:** [Link para o modelo original no Hugging Face, se houver]
* **Developer:** brunoconterato
## License Information
This model is provided under and subject to the **Gemma Terms of Use**.
By downloading or using this model, you agree to be bound by these terms.
**Key obligations include:**
* Compliance with the [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy).
* Providing a copy of the [Gemma Terms of Use](https://ai.google.dev/gemma/terms) to any third-party recipients.
* Prominent notice that this is a modified (quantized) version.
**Please ensure you read and understand the full terms:**
* [Gemma Terms of Use (Full Agreement)](https://ai.google.dev/gemma/terms)
* [Gemma Prohibited Use Policy](https://ai.google.dev/gemma/prohibited_use_policy)
A copy of the "Gemma Terms of Use" is also included in this repository as `Gemma_Terms_of_Use.txt`.
## How to use with Ollama
To run this model with Ollama, first ensure you have [Ollama installed](https://ollama.com/download) and running.
Then, you can pull this model:
```bash
ollama run hf.co/brunoconterato/brunoconterato/Gemma-3-Gaia-PT-BR-4b-it-GGUF-F16
---

3
gemma_3_gaia_f16.gguf Executable file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:23a580c185636bbd077108f6406b6ff1268db9bb481a843dd8bc6f0e1c9bdb88
size 7767803648

279
instructions.md Normal file
View File

@@ -0,0 +1,279 @@
# Guia Completo: Convertendo, Quantizando e Publicando LLMs em GGUF para Ollama e Hugging Face
Este guia detalha o processo para pegar um modelo de linguagem (LLM) do Hugging Face em seu formato original (como `safetensors`), convertê-lo para o formato GGUF usando o `llama.cpp` via Docker, otimizá-lo através de quantização (em diferentes níveis de precisão) e, finalmente, disponibilizá-lo para uso local com Ollama e para publicação pública no Hugging Face (ou na biblioteca oficial do Ollama).
## Objetivos
- Compreender a diferença entre conversão de formato, quantização FP16 e quantização de baixa precisão (Q4_K_M, etc.).
- Converter um modelo LLM do Hugging Face para o formato GGUF em precisão FP16.
- Quantizar o modelo GGUF FP16 para precisões mais baixas (ex: Q4_K_M) para otimização de desempenho e tamanho.
- Rodar o modelo GGUF localmente usando Ollama.
- Publicar o modelo GGUF no Hugging Face Model Hub para que possa ser baixado e usado por outros via Ollama.
- Compreender e aplicar as exigências de licenciamento para modelos como o Gemma.
---
## 1. Pré-requisitos
Antes de começar, certifique-se de ter as seguintes ferramentas instaladas e configuradas no seu sistema:
- **Docker:** Para rodar o ambiente `llama.cpp` isoladamente.
- [Instalação do Docker](https://docs.docker.com/get-docker/)
- **Git:** Para clonar repositórios e gerenciar versões.
- [Instalação do Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- **Git LFS (Large File Storage):** Essencial para baixar e fazer upload de arquivos grandes (`.safetensors`, `.gguf`) no Git.
```bash
sudo apt update && sudo apt install git-lfs # Linux Mint/Ubuntu
git lfs install # configuração única
```
* **Python 3 e `pip`:**
```bash
sudo apt install python3 python3-pip # Linux Mint/Ubuntu
```
* **`huggingface_hub` (CLI):** Ferramentas de linha de comando para interagir com o Hugging Face.
```bash
pip install huggingface_hub
```
* **Ollama:** Para rodar os modelos GGUF localmente.
- [Instalação do Ollama](https://ollama.com/download)
---
## 2. Preparação do Ambiente e Modelo
### 2.1. Instalação e Configuração do Ollama (Local)
1. Baixe e instale conforme seu sistema operacional.
2. Verifique a instalação executando:
```bash
ollama
```
Deve exibir a lista de comandos disponíveis.
### 2.2. Criar Diretórios e Baixar o Modelo
Estrutura recomendada:
```
~/Workspace/Models/
- meu_modelo_original/ # arquivos do Hugging Face
- saida_gguf/ # saída das conversões e quantizações
```
Crie com:
```bash
mkdir -p ~/Workspace/Models/meu_modelo_original
mkdir -p ~/Workspace/Models/saida_gguf
```
Clone o modelo:
```bash
cd ~/Workspace/Models/
git clone https://huggingface.co/CEIA-UFG/Gemma-3-Gaia-PT-BR-4b-it meu_modelo_original
```
Garanta que o Git LFS foi instalado antes de clonar, para baixar os arquivos grandes corretamente.
---
## 3. Conversão e Quantização (via Docker)
Usaremos a imagem `ghcr.io/ggml-org/llama.cpp:full`.
### 3.1. Pull da Imagem Docker
```bash
docker pull ghcr.io/ggml-org/llama.cpp:full
```
### 3.2. Converter para GGUF + FP16
```bash
docker run --rm -it \
--entrypoint /bin/bash \
-v ~/Workspace/Models/meu_modelo_original:/app/model_in:ro \
-v ~/Workspace/Models/saida_gguf:/app/model_out \
ghcr.io/ggml-org/llama.cpp:full \
-c "cd /llama.cpp && python3 convert_hf_to_gguf.py /app/model_in \
--outtype f16 \
--outfile /app/model_out/gemma_3_gaia_f16.gguf"
```
### 3.3. Quantizar p/ Q4_K_M (4 bits)
```bash
docker run --rm -it \
--entrypoint /bin/bash \
-v ~/Workspace/Models/saida_gguf:/app/model_out \
ghcr.io/ggml-org/llama.cpp:full \
-c "cd /llama.cpp && ./quantize \
/app/model_out/gemma_3_gaia_f16.gguf \
/app/model_out/gemma_3_gaia_q4_k_m.gguf \
Q4_K_M"
```
---
## 4. Utilizando o Modelo no Ollama (Local)
Agora você terá, por exemplo, `gemma_3_gaia_f16.gguf` e/ou `gemma_3_gaia_q4_k_m.gguf` dentro de `~/Workspace/Models/saida_gguf`.
### 4.1. Criar um `Modelfile`
No diretório da saída:
```bash
cd ~/Workspace/Models/saida_gguf
nano Modelfile
```
Conteúdo:
```text
# Modelfile
FROM gemma_3_gaia_q4_k_m.gguf
# Exemplo de SYSTEM prompt
SYSTEM """Você é um assistente de IA prestativo e amigável."""
# Exemplos de parâmetros (ajuste conforme sua RAM/VRAM)
# PARAMETER temperature 0.7
# PARAMETER top_k 40
# PARAMETER top_p 0.9
# PARAMETER num_ctx 4096
```
### 4.2. Importar para Ollama
```bash
ollama create brunoconterato/Gemma-3-Gaia-PT-BR-4b-it:q4_k_m -f Modelfile
# (ou para F16):
# ollama create brunoconterato/Gemma-3-Gaia-PT-BR-4b-it:f16 -f Modelfile
```
### 4.3. Rodar o Modelo
```bash
ollama run brunoconterato/Gemma-3-Gaia-PT-BR-4b-it:q4_k_m
```
---
## 5. Publicando o Modelo para Compartilhamento
Temos duas formas principais de publicar: via Hugging Face ou via biblioteca oficial do Ollama.
### 5.1. No Hugging Face Model Hub
#### 5.1.1. Criar Repositório
- Vá ao Hugging Face e crie um repositório público (ex: `Gemma-3-Gaia-PT-BR-4b-it-GGUF-F16`), escolhendo a licença adequada.
#### 5.1.2. Preparar Repositório Local
```bash
cd ~/Workspace/Models/saida_gguf
git init
git lfs install
git lfs track "*.gguf"
```
#### 5.1.3. Adicionar arquivos essenciais
Crie ou atualize:
````markdown
---
license: gemma
language:
- pt
base_model:
- CEIA-UFG/Gemma-3-Gaia-PT-BR-4b-it
- google/gemma-3-4b-it
---
# Gemma-3-Gaia-PT-BR-4b-it – GGUF Quantizado por brunoconterato (F16)
Este repositório contém uma versão quantizada (16‑bit) do modelo **Gemma‑3‑Gaia‑PT‑BR‑4b‑it**, otimizada para uso com [Ollama](https://ollama.com/).
**Detalhes do modelo:**
- **Base model:** Gemma‑3‑Gaia‑PT‑BR‑4b‑it
- **Quantização:** F16
- **Origem:** https://huggingface.co/CEIA-UFG/Gemma-3-Gaia-PT-BR-4b-it
- **Desenvolvedor:** brunoconterato
## Licença
Este modelo está disponível sob os **Gemma Terms of Use**. Ao baixar ou usar, você concorda com:
- Políticas de uso proibido (Prohibited Use Policy) conforme exigido.
- Inclusão dos termos completos da licença.
- Aviso de modificação (quantização).
Arquivos adicionais:
- `Gemma_Terms_of_Use.txt` – texto completo da licença oficial.
- `NOTICE.txt` – aviso exigido pela licença (veja abaixo).
## Uso com Ollama
```bash
ollama run hf.co/brunoconterato/Gemma-3-Gaia-PT-BR-4b-it-GGUF-F16
```
````
````
Crie também:
```bash
echo "Gemma is provided under and subject to the Gemma Terms of Use found at ai.google.dev/gemma/terms" > NOTICE.txt
````
Adicione tudo:
```bash
git add README.md Gemma_Terms_of_Use.txt NOTICE.txt gemma_3_gaia_f16.gguf
git commit -m "Initial commit: Gemma‑3‑Gaia‑PT‑BR‑4b‑it GGUF (F16) model + documentação e licença"
```
#### 5.1.4. Conectar e Enviar
```bash
huggingface-cli login
huggingface-cli lfs-enable-largefiles .
git remote add origin https://huggingface.co/brunoconterato/Gemma-3-Gaia-PT-BR-4b-it-GGUF-F16
git push -u origin main
```
### 5.2. Biblioteca oficial do Ollama
1. Configure sua chave pública SSH (`~/.ollama/id_ed25519.pub` ou equivalente).
2. Copie o modelo local para o namespace de publicação:
```bash
ollama cp brunoconterato/Gemma-3-Gaia-PT-BR-4b-it:q4_k_m brunoconterato/Gemma-3-Gaia-PT-BR-4b-it:q4_k_m
```
3. Publique:
```bash
ollama push brunoconterato/Gemma-3-Gaia-PT-BR-4b-it:q4_k_m
```
---
## 6. Considerações Finais
- **Licenciamento Gemma:** exige atribuição, redistribuição dos termos de uso e aviso de modificação mesmo em derivados.
- **Hardware:** mesmo quantizados, LLMs exigem memória RAM/VRAM suficiente—verifique seu sistema antes de rodar.