--- library_name: peft license: mit language: - en pipeline_tag: text-generation datasets: - vicgalle/alpaca-gpt4 --- # AlpaGo: GPT-NeoX-20B Model Trained with QloRA Technique AlpaGo is an adapter model trained using the QloRA technique on top of the [GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b) model. This repository contains the code and resources for AlpaGo, which can be used for natural language processing tasks. AlpaGo is built on the [GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b) architecture and developed by Math And AI Institute. ## Features - AlpaGo adapter model trained with the QloRA technique - Based on the [GPT-NeoX-20B](https://huggingface.co/EleutherAI/gpt-neox-20b) model, providing high-quality natural language processing capabilities on Engilish Language ## Evaluation - Coming soon ## Usage You can utilize AlpaGo to perform natural language processing tasks. Here's an example of how to use it: To try via Google Colab Free: Colab Demo You can even run it on your own computer if you want. Warning: You need at least 15 GB VRAM ```python from peft import PeftModel import torch from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig, GenerationConfig model_id = "EleutherAI/gpt-neox-20b" tokenizer = AutoTokenizer.from_pretrained(model_id) bnb_config = BitsAndBytesConfig( load_in_4bit=True, bnb_4bit_use_double_quant=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16 ) model = AutoModelForCausalLM.from_pretrained(model_id, quantization_config=bnb_config, device_map="auto") model = PeftModel.from_pretrained(model, "myzens/AlpaGo") #You can change Here. PROMPT = """Below is an instruction that describes a task. Write a response that appropriately completes the request. ### Instruction: Write a short story about a lost key that unlocks a mysterious door. ### Response:""" inputs = tokenizer(PROMPT, return_tensors="pt") input_ids = inputs["input_ids"].cuda() generation_config = GenerationConfig( temperature=0.6, top_p=0.95, repetition_penalty=1.15, ) print("Generating...") generation_output = model.generate( input_ids=input_ids, generation_config=generation_config, return_dict_in_generate=True, output_scores=True, max_new_tokens=256, eos_token_id=tokenizer.eos_token_id, pad_token_id=tokenizer.pad_token_id, ) for s in generation_output.sequences: print(tokenizer.decode(s)) ``` ## Thanks We would like to thank our teacher Ünver Çiftçi for their support. Thank you to those who wholeheartedly support us on our server. ## Contact | Name | LinkedIn | | ------------------ | ------------------------------------------------------- | | Ünver Çiftçi | [LinkedIn](https://www.linkedin.com/in/unverciftci/) | | Talha Rüzgar Akkuş | [LinkedIn](https://www.linkedin.com/in/talha-r%C3%BCzgar-akku%C5%9F-1b5457264/) | | Ethem Yağız Çalık | [LinkedIn](https://www.linkedin.com/in/ethem-ya%C4%9F%C4%B1z-%C3%A7al%C4%B1k-799a73275/) | | Tarık Kaan Koç | [LinkedIn](https://www.linkedin.com/in/kaankc/) | | Mehmet Taşan | [LinkedIn](https://www.linkedin.com/in/mehmet-ta%C5%9Fan-msc-bb521126/) |