Update README.md
Browse files
README.md
CHANGED
|
@@ -36,7 +36,7 @@ model_id = "FatihJimale/gpt2-medium-somali"
|
|
| 36 |
tok = AutoTokenizer.from_pretrained(model_id)
|
| 37 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
| 38 |
|
| 39 |
-
prompt = "
|
| 40 |
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 41 |
outputs = model.generate(
|
| 42 |
**inputs,
|
|
@@ -107,7 +107,7 @@ model_id = "FatihJimale/gpt2-medium-somali"
|
|
| 107 |
tok = AutoTokenizer.from_pretrained(model_id)
|
| 108 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
| 109 |
|
| 110 |
-
prompt = "
|
| 111 |
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 112 |
outputs = model.generate(**inputs, max_new_tokens=80, do_sample=True, temperature=0.9, top_p=0.92, repetition_penalty=1.08)
|
| 113 |
print(tok.decode(outputs[0], skip_special_tokens=True))
|
|
|
|
| 36 |
tok = AutoTokenizer.from_pretrained(model_id)
|
| 37 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
| 38 |
|
| 39 |
+
prompt = "roob xoogan ayaa ka da'ay magaalada"
|
| 40 |
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 41 |
outputs = model.generate(
|
| 42 |
**inputs,
|
|
|
|
| 107 |
tok = AutoTokenizer.from_pretrained(model_id)
|
| 108 |
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
| 109 |
|
| 110 |
+
prompt = "roob xoogan ayaa ka da'ay magaalada"
|
| 111 |
inputs = tok(prompt, return_tensors="pt").to(model.device)
|
| 112 |
outputs = model.generate(**inputs, max_new_tokens=80, do_sample=True, temperature=0.9, top_p=0.92, repetition_penalty=1.08)
|
| 113 |
print(tok.decode(outputs[0], skip_special_tokens=True))
|