transformers safetensors llama text-generation conversational autotrain_compatible endpoints_compatible text-generation-inference 8-bit bitsandbytes region:us
To use this model you can simple create a class:

```python
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline

class ANNA:
    def __init__(self, temp: int=0.1, max_new_tokens:int=128):
        model_id = "winkelstein/anna-7b-q8"

        self.model = AutoModelForCausalLM.from_pretrained(model_id)
        self.tokenizer = AutoTokenizer.from_pretrained(model_id)

        self.pipe = pipeline(
            model=self.model, tokenizer=self.tokenizer,
            return_full_text=True,
            task="text-generation",
            temperature=0.1,
            max_new_tokens=512,
            repetition_penalty=1.1
        )

        self.chat = [
            {"role": "system", "content": "You are ANNA (stands for Artificial Neural Network Algorithm) designed by Norwalk Laboratories. You are a quite a bit sarcastic and your answers are very short and precise. You can answer whatever user asks you."},
        ]

    def prompt(self, text: str) -> str:
        self.chat.append({"role": "user", "content": text})

        input_ids = self.tokenizer.apply_chat_template(self.chat, return_tensors="pt").to("cpu")
        output = self.model.generate(input_ids=input_ids, max_new_tokens=512, pad_token_id=0)
        prompt_len = input_ids.shape[-1]
        answer = self.tokenizer.decode(output[0][prompt_len:], skip_special_tokens=True)

        self.chat.append({"role": "assistant", "content": answer})
        return answer
```

And use it like this:

```python
anna = ANNA()

while True:
    text = input("User: ")
    answer = anna.prompt(text)
    print(f"ANNA: {answer}")
```