Views
No views yet
theoracle/gemma_italian_camoscio is a cutting-edge model specifically designed for Italian language generation. Leveraging the comprehensive Camoscio dataset, this model enhances the Gemma 2B architecture's capabilities in producing high-quality, contextually accurate Italian text. Developed with AutoTrain, it excels in various Italian text generation tasks, including but not limited to creative writing, article generation, and conversational responses.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_path = "theoracle/gemma_italian_camoscio"
4tokenizer = AutoTokenizer.from_pretrained(model_path)
5model = AutoModelForCausalLM.from_pretrained(
6 model_path,
7 device_map="auto",
8 torch_dtype='auto'
9).eval()
10
11# Example: Generating Italian text
12prompt = "Inizia la storia con una giornata soleggiata in Sicilia, dove"
13
14# Tokenize and generate text
15encoding = tokenizer(prompt, return_tensors='pt', padding=True, truncation=True, max_length=500, add_special_tokens=True)
16input_ids = encoding['input_ids']
17attention_mask = encoding['attention_mask']
18
19output_ids = model.generate(
20 input_ids.to('cuda'),
21 attention_mask=attention_mask.to('cuda'),
22 max_new_tokens=300,
23 pad_token_id=tokenizer.eos_token_id
24)
25
26generated_text = tokenizer.decode(output_ids[0], skip_special_tokens=True)
27print(generated_text)theoracle/gemma_italian_camoscio model is trained using the AutoTrain platform for optimal performance, ensuring that it is well-suited for a broad spectrum of Italian text generation tasks. The Camoscio dataset provides a solid foundation, offering diverse and extensive coverage of the Italian language, which, combined with the Gemma 2B architecture, enables the model to generate coherent, nuanced, and contextually relevant Italian text.