🚀 Strela - A Powerful Language Model
Strela is a powerful language model designed to ensure high - speed operation and quality responses on low - end devices. It is recommended for the following purposes:
- Chatbot for dialogues
- Story writer
- Song writer
- Translation between Russian and English
- When it's inefficient to use heavier models
📚 Documentation
Self - description from Strela
I am a computer program developed for processing and analyzing natural language. I have the ability to understand, analyze, and process natural language, enabling me to communicate with people through various communication channels. My main goal is to help people solve problems and provide information based on their requests. I can be used for various purposes, from automatic text generation, translation from one language to another, or even creating my own poems and songs.
Using the model online
You can try it here.
Using the model for chat in an application
It is recommended to use GTP4ALL. It supports GGUF, so you need to download a special version of the model in GGUF format.
Using the model for chat in Unity
It is recommended to use LLM for Unity. It supports GGUF, so you need to download a special version of the model in GGUF format.
Using the quantized model for chat in Python | Recommended
You should install gpt4all
pip install gpt4all
Then, download the GGUF version of the model and move the file to your script's directory.
import os
from gpt4all import GPT4All
model = GPT4All(model_name='strela-q4_k_m.gguf', model_path=os.getcwd())
def stop_on_token_callback(token_id, token_string):
if '#' in token_string:
return False
else:
return True
system_template = """### System:
You are an AI assistant who gives a helpfull response to whatever human ask of you.
"""
prompt_template = """
### Human:
{0}
### Assistant:
"""
with model.chat_session(system_template, prompt_template):
print("To exit, enter 'Exit'")
while True:
print('')
user_input = input(">>> ")
if user_input.lower() != "exit":
for token in model.generate(user_input, streaming=True, callback=stop_on_token_callback):
print(token, end='')
else:
break
To exit, enter 'Exit'
>>> Hello
Hello! How can I help you today?
>>>
Using the full - fledged model for chat in Python
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("gai-labs/strela")
model = AutoModelForCausalLM.from_pretrained("gai-labs/strela")
system_prompt = "You are an AI assistant who gives a helpfull response to whatever human ask of you."
prompt = "Hello!"
chat = f"""### System:
{system_prompt}
### Human:
{prompt}
### Assistant:
"""
model_inputs = tokenizer([chat], return_tensors="pt")
generated_ids = model.generate(**model_inputs, max_new_tokens=64)
output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
output = output.replace(chat, "")
print(output)
Hello! How can I help?
Using the model for text generation in Python
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("gai-labs/strela")
model = AutoModelForCausalLM.from_pretrained("gai-labs/strela")
prompt = "AI - "
model_inputs = tokenizer([prompt], return_tensors="pt")
generated_ids = model.generate(**model_inputs, max_new_tokens=64)
output = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(output)
AI - is a field of computer science and technology that deals with creating machines capable of "understanding" humans or performing tasks with similar logic as humans.
📄 License
This project is licensed under the CC - BY - SA 4.0 license.