Upload IVRIUS_notebook2.ipynb with huggingface_hub
Browse files- IVRIUS_notebook2.ipynb +2 -5
IVRIUS_notebook2.ipynb
CHANGED
|
@@ -32,10 +32,7 @@
|
|
| 32 |
"cell_type": "code",
|
| 33 |
"metadata": {},
|
| 34 |
"source": [
|
| 35 |
-
"# ── Célula 1: Instalar dependências ──────────────────────────────\n"
|
| 36 |
-
"!pip install -q transformers accelerate bitsandbytes sentencepiece\n",
|
| 37 |
-
"!pip install -q sentence-transformers datasets huggingface_hub\n",
|
| 38 |
-
"print('✅ Dependências instaladas!')"
|
| 39 |
],
|
| 40 |
"execution_count": null,
|
| 41 |
"outputs": []
|
|
@@ -62,7 +59,7 @@
|
|
| 62 |
"cell_type": "code",
|
| 63 |
"metadata": {},
|
| 64 |
"source": [
|
| 65 |
-
"# ── Célula 3: Carregar Jurema-7B
|
| 66 |
],
|
| 67 |
"execution_count": null,
|
| 68 |
"outputs": []
|
|
|
|
| 32 |
"cell_type": "code",
|
| 33 |
"metadata": {},
|
| 34 |
"source": [
|
| 35 |
+
"# ── Célula 1: Instalar dependências ──────────────────────────────\n!pip install -q llama-cpp-python --extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cu121\n!pip install -q sentence-transformers datasets huggingface_hub\nprint('✅ Dependências instaladas!')"
|
|
|
|
|
|
|
|
|
|
| 36 |
],
|
| 37 |
"execution_count": null,
|
| 38 |
"outputs": []
|
|
|
|
| 59 |
"cell_type": "code",
|
| 60 |
"metadata": {},
|
| 61 |
"source": [
|
| 62 |
+
"# ── Célula 3: Carregar Jurema-7B GGUF via llama-cpp ─────────────\nfrom llama_cpp import Llama\nfrom huggingface_hub import hf_hub_download\n\nprint('📥 Baixando Jurema-7B GGUF...')\n\n# Baixa o GGUF do HuggingFace\ngguf_path = hf_hub_download(\n repo_id=\"MMR408/proejto2\",\n filename=\"jurema-7b-q4_k_m.gguf\",\n repo_type=\"dataset\",\n token=HF_TOKEN\n)\nprint(f'✅ Download completo: {gguf_path}')\n\nprint('📥 Carregando Jurema-7B na memória...')\nmodel_jurema = Llama(\n model_path=gguf_path,\n n_gpu_layers=-1, # usa GPU toda\n n_ctx=2048,\n verbose=False\n)\n\ndef pipe(prompt_text):\n output = model_jurema(\n prompt_text,\n max_tokens=512,\n temperature=0.3,\n stop=[\"```\", \"\\n\\n\\n\"]\n )\n return [{\"generated_text\": prompt_text + output[\"choices\"][0][\"text\"]}]\n\nprint('✅ Jurema-7B carregado!')"
|
| 63 |
],
|
| 64 |
"execution_count": null,
|
| 65 |
"outputs": []
|