The Conversational Spanish GPT is a refined model based on
DialoGPT-small, fine-tuned with a robust set of 96,437 conversations in Spanish. Created by Josemaría Vargas Vasconcellos, this model aims to serve as a solid foundation for the development of conversational models in Spanish.
The model was trained using Spanish datasets available in
Microsoft's Bot Framework Tools repository. A carefully curated set of
96,437 single-turn conversations in Spanish was meticulously selected to mitigate quality and coherence issues.
After exhaustive evaluations, it was found that the model is not ideal for deployment as a contextual chatbot. However, it serves as a promising foundation for such applications. Responses tend to be brief and sometimes lack a defined focus due to conversation data diversity. Additionally, the wide range of personalities reflected in the data increases response variability.
Frequent repetitions in the data's responses have introduced certain "biases" into the model.
The model currently has its testing function disabled on HuggingFace due to inaccurate responses. However, users can experiment with the model using the provided code snippets:
1import torch
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4CHAT_TURNS = 5
5MAX_LENGTH = 1000
6
7model = AutoModelForCausalLM.from_pretrained('ostorc/Conversational_Spanish_GPT')
8tokenizer = AutoTokenizer.from_pretrained('ostorc/Conversational_Spanish_GPT')
9device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
10model.to(device)
11for i in range(CHAT_TURNS):
12 user_input = input(f"Step - {i} >> Human ->")
13 with torch.no_grad():
14 # User turn, where "user_input" is the question (single-turn dialogue task)
15 user_inputs_ids = tokenizer.encode(user_input + tokenizer.eos_token, return_tensors="pt")
16 user_inputs_ids = user_inputs_ids.to(device)
17 # The chat history adds the generated tokens for the answer
18 chat_history = model.generate(user_inputs_ids, max_length=MAX_LENGTH, pad_token_id=tokenizer.eos_token_id)
19 # decode just the last generated output tokens from the model (do not include the user prompt again)
20 step_model_answer = tokenizer.decode(chat_history[:, user_inputs_ids.shape[-1]:][0], skip_special_tokens=True)
21 print(f"Step - {i} >> Bot -> {step_model_answer}")
If you come across any errors or have suggestions to enhance the model, feel free to share your thoughts in the accompanying comments. We appreciate your interest and collaboration.