Can be integrated into multilingual NLP pipelines or localization workflows.
Out-of-Scope Use
Languages other than English or Faroese.
Tasks like summarization, classification, or dialogue without further fine-tuning.
Bias, Risks, and Limitations
As with all translation models, may reflect biases from the training corpora.
Outputs should be carefully validated for sensitive or high-stakes domains.
How to Get Started with the Model
importtorchfromtransformersimportAutoTokenizer,AutoModelForCausalLM,BitsAndBytesConfigimportreimportpandasaspd# Model repoMODEL_NAME="barbaroo/gptsw3-6.7B-translation-en-fo"# Quantization config (8-bit)bnb_config=BitsAndBytesConfig(load_in_8bit=True)# Initialize tokenizer & modeltokenizer=AutoTokenizer.from_pretrained(MODEL_NAME)model=AutoModelForCausalLM.from_pretrained(MODEL_NAME,quantization_config=bnb_config,device_map="auto",)model.eval()# Alpaca-style prompt templatealpaca_prompt="""
### Instruction:
{}### Input:
{}### Response:
{}"""EOS_TOKEN=tokenizer.eos_tokenprint("EOS token:",EOS_TOKEN)# Example sentencessentences=["I love Faroese!"]translations=[]forsentenceinsentences:inputs=tokenizer([alpaca_prompt.format("Translate this sentence from English to Faroese:",sentence,"",)],return_tensors="pt").to("cuda")outputs=model.generate(**inputs,max_new_tokens=500,use_cache=True,do_sample=True,temperature=0.1,top_p=1,)output_string=tokenizer.batch_decode(outputs,skip_special_tokens=False)[0]try:response=output_string.split("Response:\n",1)[1]translation=response.replace(EOS_TOKEN,"")exceptIndexError:translation=""translations.append(translation)print(translation)