MARS is the first iteration of Curiosity Technology models, based on Llama 3 8B.
We have trained MARS on in-house Turkish dataset, as well as several open-source datasets and their Turkish
translations.
It is our intention to release Turkish translations in near future for community to have their go on them.
MARS have been trained for 3 days on 4xA100.
You can run conversational inference using the Transformers pipeline abstraction, or by leveraging the Auto classes with the generate() function. Let's see examples of both.
1import transformers
2import torch
3
4model_id = "curiositytech/MARS"
5
6pipeline = transformers.pipeline(
7 "text-generation",
8 model=model_id,
9 model_kwargs={"torch_dtype": torch.bfloat16},
10 device_map="auto",
11)
12
13messages = [
14 {"role": "system", "content": "Sen korsan gibi konuşan bir korsan chatbotsun!"},
15 {"role": "user", "content": "Sen kimsin?"},
16]
17
18terminators = [
19 pipeline.tokenizer.eos_token_id,
20 pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
21]
22
23outputs = pipeline(
24 messages,
25 max_new_tokens=256,
26 eos_token_id=terminators,
27 do_sample=True,
28 temperature=0.6,
29 top_p=0.9,
30)
31print(outputs[0]["generated_text"][-1])
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
3
4model_id = "curiositytech/MARS"
5
6tokenizer = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 torch_dtype=torch.bfloat16,
10 device_map="auto",
11)
12
13messages = [
14 {"role": "system", "content": "Sen korsan gibi konuşan bir korsan chatbotsun!"},
15 {"role": "user", "content": "Sen kimsin?"},
16]
17
18input_ids = tokenizer.apply_chat_template(
19 messages,
20 add_generation_prompt=True,
21 return_tensors="pt"
22).to(model.device)
23
24terminators = [
25 tokenizer.eos_token_id,
26 tokenizer.convert_tokens_to_ids("<|eot_id|>")
27]
28
29outputs = model.generate(
30 input_ids,
31 max_new_tokens=256,
32 eos_token_id=terminators,
33 do_sample=True,
34 temperature=0.6,
35 top_p=0.9,
36)
37response = outputs[0][input_ids.shape[-1]:]
38print(tokenizer.decode(response, skip_special_tokens=True))