squarelike/sharegpt_deepl_ko_translation
Viewer โข Updated โข 487k โข 69 โข 17
How to use squarelike/Gugugo-koen-7B-V1.1-AWQ with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline
pipe = pipeline("translation", model="squarelike/Gugugo-koen-7B-V1.1-AWQ") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("squarelike/Gugugo-koen-7B-V1.1-AWQ")
model = AutoModelForCausalLM.from_pretrained("squarelike/Gugugo-koen-7B-V1.1-AWQ", device_map="auto")Detail repo: https://github.com/jwj7140/Gugugo

Base Model: Llama-2-ko-7b
Training Dataset: sharegpt_deepl_ko_translation.
I trained with 1x A6000 GPUs for 90 hours.
KO->EN
### ํ๊ตญ์ด: {sentence}</๋>
### ์์ด:
EN->KO
### ์์ด: {sentence}</๋>
### ํ๊ตญ์ด:
from vllm import LLM, SamplingParams
def make_prompt(data):
prompts = []
for line in data:
prompts.append(f"### ์์ด: {line}</๋>\n### ํ๊ตญ์ด:")
return prompts
texts = [
"Hello world!",
"Nice to meet you!"
]
prompts = make_prompt(texts)
sampling_params = SamplingParams(temperature=0.01, stop=["</๋>"], max_tokens=700)
llm = LLM(model="squarelike/Gugugo-koen-7B-V1.1-AWQ", quantization="awq", dtype="half")
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
print(output.outputs[0].text)