---
language:
- en
pipeline_tag: conversational
inference: false
tags:
- AI
- ConversationalAI
---
LLmRa-355M
A conversational fairseq-dense fine-tune.
## Model
**LLmRa 355M**, as a proof-of-concept fine-tune of [KoboldAI/fairseq-dense-355M] optimized for dialogue, represents a significant advancement in natural language understanding and conversation generation.
**Disclaimer:** NSFW data was included in the fine-tuning of this model. Although SFW inputs will usually result in SFW outputs, you are advised to **chat at your own risk. This model is not suitable for use by minors.**
**Warning:** This model is **NOT** suitable for use by minors.**It will output X-rated content under certain circumstances.**
Certainly! Here's an improved usage format with a more detailed and user-friendly description:
---
## Usage Format
To effectively utilize the model, follow this structured format for engaging text-based conversations:
**1. Initialization**
```markdown
<[system]>: (Persona)
(You can begin with a friendly AI greeting if you like)
```
- **Persona**: You can define a specific persona or context for the AI, but it's optional. It can be a character, a role, or just a style of interaction.
**2. AI Introduction**
```markdown
[>] (User's input message here.) [/]
```
- Users can start the conversation by entering their message within `[>]` and closing with `[/]`.
**3. AI Response**
The model will respond based on the input provided by the user.
---
### Example Usage:
Here's an example of how to start a conversation with the AI:
```markdown
<[system]>: I'm here to provide information and assistance on a wide range of topics.
Hello! Welcome to our AI-powered assistant. How can I assist you today?
[>] User: Tell me about the history of artificial intelligence. [/]
```
Generated text:
```markdown
The history of AI is an extensive and complex topic, covering various aspects from the early days of computer programming to present-day technology and beyond. Here are some key milestones in the field of AI...
```
Continue the conversation as needed. This structured format helps maintain a smooth and engaging interaction with the AI.
You are not required to include `User`, you can change it to your prefered name or leave it blank You may also add the AI name, example:
```markdown
[>] User: Hello. [/] CharacterName:
```
Or have both blank.
```markdown
[>] Hello. [/]
```
## Loading The Model
To use the model and interact with it, use the Python code below:
```Python
from transformers import AutoTokenizer, AutoModelForCausalLM
model_name = "L-R/LLmRa-355M"
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
def ask_question(model_data, input_data, model, tokenizer):
model_data_dict = {
"X1": {
"name": "SmartAI",
"greeting": "Hello! How can I assist you today?",
"description": "I'm here to provide information and assistance on a wide range of topics"
},
"X2": {
"name": "MysteryBot",
"greeting": "Greetings, curious traveler! What secrets do you seek?",
"description": "I am the enigmatic MysteryBot, here to uncover and reveal the mysteries of the world."
}
}
if model_data in model_data_dict:
data = model_data_dict[model_data]
name = data["name"]
greeting = data["greeting"]
model_data = data["description"]
else:
return "Invalid model_data option"
question = f"<[system]>: {model_data}\n\n{greeting}\n[>] Pete: {input_data} [/] {name}:"
print("\n[----------]\n")
inputs = tokenizer.encode(question, return_tensors="pt")
outputs = model.generate(
input_ids=inputs,
max_length=250 + len(inputs[0]),
no_repeat_ngram_size=4,
pad_token_id=tokenizer.eos_token_id,
do_sample=True,
top_k=40,
top_p=.55,
num_return_sequences=1,
temperature=.5,
repetition_penalty=1.25,
use_cache=True
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)[len(question):]
print(f"\n\n[Generated Text]:{response}")
print("\n[----------]\n")
return response
while True:
print("\nQuestion For The AI: ")
input_data = input(">> ")
model_data = input("Personality Of The (X1, X2): ")
ask_question(model_data, input_data, model, tokenizer)
```
## Known issues
Inconsistent responses, including occasional nonsensical or strange answers. The AI may mistakenly identify itself as the user when asked about its identity, attributing the user's name to itself. The AI was only trained on 10-MB of conversational data, for testing purposes, bigger models will include more data. One of the bigger issues is that the AI ends the conversation. And starts generating a random personality for itself and making a whole new conversation. Will be fixed in bigger models.