
<div style="text-align:center;width:350px;height:350px;">
    <img src="https://huggingface.co/hackathon-somos-nlp-2023/SalpiBloom-1b1/resolve/main/salpibloom.png" alt="SAlpaca logo"">
</div>



# SAlpiBloom: Spanish + Alpaca + Bloom  (WIP)
Learning rate = 3e-4

## Adapter Description
This adapter was created with the [PEFT](https://github.com/huggingface/peft) library and allowed the base model [bigscience/bloom-1b1](https://huggingface.co/bigscience/bloom-1b1) to be fine-tuned on the [Spanish Alpaca Dataset](https://huggingface.co/datasets/bertin-project/alpaca-spanish) by using the method *LoRA*.


## How to use
```py
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer

peft_model_id = "hackathon-somos-nlp-2023/SalpiBloom_base_lr3e4_1b1"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
# tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
tokenizer = AutoTokenizer.from_pretrained(peft_model_id)

# Load the Lora model
model = PeftModel.from_pretrained(model, peft_model_id)

def gen_conversation(text):
  text = "<SC>instruction: " + text + "\n "
  batch = tokenizer(text, return_tensors='pt')
  with torch.cuda.amp.autocast():
    output_tokens = model.generate(**batch, max_new_tokens=256, eos_token_id=50258, early_stopping = True, temperature=.9)

  print('\n\n', tokenizer.decode(output_tokens[0], skip_special_tokens=False))

text = "Redacta un cuento corto"
gen_conversation(text)
```


## Resources used
Google Colab machine with the following specifications
<div style="text-align:center;width:550px;height:550px;">
    <img src="https://huggingface.co/hackathon-somos-nlp-2023/bertin-gpt-j-6B-es-finetuned-salpaca/resolve/main/resource.jpeg" alt="Resource logo">
</div>

## Citation
```
@misc {hackathon-somos-nlp-2023,
	author       = { {Edison Bejarano, Leonardo Bolaños, Alberto Ceballos, Santiago Pineda, Nicolay Potes} },
	title        = { SalpiBloom_base_lr3e4_1b1 },
	year         = 2023,
	url          = { https://huggingface.co/hackathon-somos-nlp-2023/SalpiBloom_base_lr3e4_1b1 }
	publisher    = { Hugging Face }
}
```
{"language": ["es"], "license": "apache-2.0", "library_name": "adapter-transformers"}
adapter-transformers es license:apache-2.0 region:us
TAGS
#adapter-transformers #es #license-apache-2.0 #region-us 


<div style="text-align:center;width:350px;height:350px;">
    <img src="URL alt="SAlpaca logo"">
</div>



# SAlpiBloom: Spanish + Alpaca + Bloom  (WIP)
Learning rate = 3e-4

## Adapter Description
This adapter was created with the PEFT library and allowed the base model bigscience/bloom-1b1 to be fine-tuned on the Spanish Alpaca Dataset by using the method *LoRA*.


## How to use



## Resources used
Google Colab machine with the following specifications
<div style="text-align:center;width:550px;height:550px;">
    <img src="URL alt="Resource logo">
</div>


# SAlpiBloom: Spanish + Alpaca + Bloom  (WIP)
Learning rate = 3e-4 ## Adapter Description
This adapter was created with the PEFT library and allowed the base model bigscience/bloom-1b1 to be fine-tuned on the Spanish Alpaca Dataset by using the method *LoRA*. ## How to use ## Resources used
Google Colab machine with the following specifications
<div style="text-align:center;width:550px;height:550px;">
    <img src="URL alt="Resource logo">
</div>
TAGS
#adapter-transformers #es #license-apache-2.0 #region-us 
 # SAlpiBloom: Spanish + Alpaca + Bloom  (WIP)
Learning rate = 3e-4 ## Adapter Description
This adapter was created with the PEFT library and allowed the base model bigscience/bloom-1b1 to be fine-tuned on the Spanish Alpaca Dataset by using the method *LoRA*. ## How to use ## Resources used
Google Colab machine with the following specifications
<div style="text-align:center;width:550px;height:550px;">
    <img src="URL alt="Resource logo">
</div>
TAGS
#adapter-transformers #es #license-apache-2.0 #region-us 
# SAlpiBloom: Spanish + Alpaca + Bloom  (WIP)
Learning rate = 3e-4## Adapter Description
This adapter was created with the PEFT library and allowed the base model bigscience/bloom-1b1 to be fine-tuned on the Spanish Alpaca Dataset by using the method *LoRA*.## How to use## Resources used
Google Colab machine with the following specifications
<div style="text-align:center;width:550px;height:550px;">
    <img src="URL alt="Resource logo">
</div>