Edit model card

This is a TowerInstruct-7B model fine-tuned for translating instructions datasets from English into Spanish. This model has GPT4 translation quality, but you can run it on your own machine for free 🎉

The model has been finetuned using ~1.500 prompts and answers from teknium/OpenHermes-2.5 translated to Spanish using GPT-4-0125-preview. The dataset is available here: https://huggingface.co/datasets/Iker/InstructTranslation-EN-ES/

This model was finetuned using axolotl, the training config is available here: https://huggingface.co/Iker/TowerInstruct-7B-v0.2-EN2ES/blob/main/Tower7B.yml

Demo

import torch
from transformers import pipeline

og = pipeline("text-generation", model="Unbabel/TowerInstruct-13B-v0.1", torch_dtype=torch.bfloat16, device_map=0)
fn7 = pipeline("text-generation", model="Iker/TowerInstruct-7B-v0.2-EN2ES", torch_dtype=torch.bfloat16, device_map=1)
fn = pipeline("text-generation", model="Iker/TowerInstruct-13B-v0.1-EN2ES", torch_dtype=torch.bfloat16, device_map=2)


msg = """
Let's use Bayes' theorem again to solve this problem:\n\nLet A represent the event that the man actually has the ability to predict dice rolls with 90% accuracy, and C represent the event of predicting correctly on the first attempt.\n\nWe want to find P(A|C), the probability that the man actually has the ability given that he predicted correctly on his first attempt.\n\nBayes' theorem states that P(A|C) = P(C|A) * P(A) / P(C)\n\nFirst, let's find P(C|A): the probability of predicting correctly on the first attempt if the man actually has the ability. Since he claims 90% accuracy, this probability is 0.9.\n\nNext, let's find P(A): the probability that someone actually has the ability to predict dice rolls with 90% accuracy. We are told this is 1%, so P(A) = 0.01.\n\nNow we need to find P(C): the overall probability of predicting correctly on the first attempt. This can be calculated as the sum of probabilities for each case: P(C) = P(C|A) * P(A) + P(C|¬A) * P(¬A), where ¬A represents not having the ability and P(¬A) = 1 - P(A) = 0.99.\n\nTo find P(C|¬A), the probability of predicting correctly on the first attempt without the ability, we use the fact that there's a 1/6 chance of guessing correctly by random chance: P(C|¬A) = 1/6.\n\nSo, P(C) = (0.9)*(0.01) + (1/6)*(0.99) = 0.009 + 0.165 = 0.174.\n\nFinally, we can calculate P(A|C) using Bayes' theorem:\n\nP(A|C) = P(C|A) * P(A) / P(C) = (0.9)*(0.01) / (0.174) ≈ 0.0517.\n\nTherefore, the probability that the man actually has the ability to predict dice rolls with 90% accuracy is approximately 5.17%.
""".strip()

messages = [
    {"role": "user", 
     "content": f"Translate the following text from English into Spanish.\n{msg}\nSpanish:"},
]

prompt = og.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = og(prompt, max_new_tokens=1024, do_sample=False)
print(outputs[0]["generated_text"])

prompt = fn7.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = fn7(prompt, max_new_tokens=1024, do_sample=False)
print(outputs[0]["generated_text"])

prompt = fn.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = fn(prompt, max_new_tokens=1024, do_sample=False)
print(outputs[0]["generated_text"])

Unbabel/TowerInstruct-13B-v0.1

This model fails with very large inputs, the answer is in Russian instead of Spanish 🥴

 Воспроизвем теорему Байеса для решения этой задачи:

Предположим, что A означает событие, когда человек действительно обладает способностью предсказывать результаты броска кубика с точностью 90%, а C означает событие правильного предсказания на первой попытке.

Мы хотим найти P(A|C), вероятность того, что у человека действительно есть способность, если он правильно предсказал на первой попытке.

Теорема Байеса утверждает, что P(A|C) = P(C|A) * P(A) / P(C)

Сначала определим P(C|A): вероятность правильного предсказания на первой попытке, если у человека действительно есть способность. Поскольку он утверждает, что его точность составляет 90%, эта вероятность равна 0,9.

Далее определим P(A): вероятность того, что у кого-то действительно есть способность предсказывать результаты броска кубика с точностью 90%. Нам сказано, что она составляет 1%, поэтому P(A) = 0,01.

Теперь нам нужно найти P(C): общую вероятность правильного предсказания на первой попытке. Это можно рассчитать как сумму вероятностей для каждого случая: P(C) = P(C|A) * P(A) + P(C|¬A) * P(¬A), где ¬A означает отсутствие способности, и P(¬A) = 1 - P(A) = 0,99.

Чтобы найти P(C|¬A), вероятность правильного предсказания на первой попытке без способности, мы используем тот факт, что существует 1/6 шанс сделать правильный выбор случайно: P(C|¬A) = 1/6.

Таким образом, P(C) = (0,9)*(0,01) / (0,174) ≈ 0,009 + 0,165 = 0,174.

Наконец, мы можем рассчитать P(A|C) с помощью теоремы Байеса:

P(A|C) = P(C|A) * P(A) / P(C) = (0,9)*(0,01) / (0,174) ≈ 0,0517.

Таким образом, вероятность того, что у человека действительно есть способность предсказывать результаты броска кубика с точностью 90%, составляет примерно 5,17%.

Iker/TowerInstruct-7B-v0.2-EN2ES

Vamos a usar de nuevo el teorema de Bayes para resolver este problema:

A representa el evento de que el hombre realmente tenga la capacidad de predecir lanzamientos de dados con un 90% de precisión, y C representa el evento de predecir correctamente en el primer intento.

Queremos encontrar P(A|C), la probabilidad de que el hombre realmente tenga la capacidad dado que predecía correctamente en su primer intento.

El teorema de Bayes establece que P(A|C) = P(C|A) * P(A) / P(C)

Primero, vamos a encontrar P(C|A): la probabilidad de predecir correctamente en el primer intento si el hombre realmente tiene la capacidad. Dado que afirma un 90% de precisión, esta probabilidad es 0.9.

A continuación, vamos a encontrar P(A): la probabilidad de que alguien realmente tenga la capacidad de predecir lanzamientos de dados con un 90% de precisión. Nos dicen que esto es del 1%, así que P(A) = 0.01.

Ahora necesitamos encontrar P(C): la probabilidad total de predecir correctamente en el primer intento. Esto se puede calcular como la suma de probabilidades para cada caso: P(C) = P(C|A) * P(A) + P(C|¬A) * P(¬A), donde ¬A representa no tener la capacidad y P(¬A) = 1 - P(A) = 0.99.

Para encontrar P(C|¬A), la probabilidad de predecir correctamente en el primer intento sin la capacidad, usamos el hecho de que hay una probabilidad del 1/6 de adivinar correctamente por azar: P(C|¬A) = 1/6.

Así, P(C) = (0.9)*(0.01) + (1/6)*(0.99) = 0.009 + 0.165 = 0.174.

Finalmente, podemos calcular P(A|C) usando el teorema de Bayes:

P(A|C) = P(C|A) * P(A) / P(C) = (0.9)*(0.01) / (0.174) ≈ 0.0517.

Por lo tanto, la probabilidad de que el hombre realmente tenga la capacidad de predecir lanzamientos de dados con un 90% de precisión es aproximadamente del 5.17%.

Iker/TowerInstruct-13B-v0.1-EN2ES

Vamos a usar de nuevo el teorema de Bayes para resolver este problema:

 Sea A el evento de que el hombre realmente tenga la capacidad de predecir lanzamientos de dados con un 90% de precisión, y C el evento de predecir correctamente en el primer intento.

 Queremos encontrar P(A|C), la probabilidad de que el hombre realmente tenga la capacidad dada que predijo correctamente en su primer intento.

 El teorema de Bayes establece que P(A|C) = P(C|A) * P(A) / P(C)

 Primero, vamos a encontrar P(C|A): la probabilidad de predecir correctamente en el primer intento si el hombre realmente tiene la capacidad. Dado que afirma un 90% de precisión, esta probabilidad es 0.9.

 A continuación, vamos a encontrar P(A): la probabilidad de que alguien realmente tenga la capacidad de predecir lanzamientos de dados con un 90% de precisión. Se nos dice que este es 1%, así que P(A) = 0.01.

 Ahora necesitamos encontrar P(C): la probabilidad general de predecir correctamente en el primer intento. Esto puede calcularse como la suma de probabilidades para cada caso: P(C) = P(C|A) * P(A) + P(C|¬A) * P(¬A), donde ¬A representa no tener la capacidad y P(¬A) = 1 - P(A) = 0.99.

 Para encontrar P(C|¬A), la probabilidad de predecir correctamente en el primer intento sin la capacidad, utilizamos el hecho de que hay una probabilidad de 1/6 de adivinar correctamente por casualidad: P(C|¬A) = 1/6.

 Así que, P(C) = (0.9)*(0.01) + (1/6)*(0.99) = 0.009 + 0.165 = 0.174.

 Finalmente, podemos calcular P(A|C) usando el teorema de Bayes:

 P(A|C) = P(C|A) * P(A) / P(C) = (0.9)*(0.01) / (0.174) ≈ 0.0517.

 Por lo tanto, la probabilidad de que el hombre realmente tenga la capacidad de predecir lanzamientos de dados con un 90% de precisión es aproximadamente 5.17%.
Downloads last month
6
Safetensors
Model size
6.74B params
Tensor type
BF16
·
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Finetuned from

Dataset used to train Iker/TowerInstruct-7B-v0.2-EN2ES