Llama3-Chinese-8B-Instruct

Llama3-Chinese-8B-InstructๅŸบไบŽLlama3-8Bไธญๆ–‡ๅพฎ่ฐƒๅฏน่ฏๆจกๅž‹๏ผŒ็”ฑLlamaไธญๆ–‡็คพๅŒบๅ’ŒAtomEcho๏ผˆๅŽŸๅญๅ›žๅฃฐ๏ผ‰่”ๅˆ็ ”ๅ‘๏ผŒๆˆ‘ไปฌไผšๆŒ็ปญๆไพ›ๆ›ดๆ–ฐ็š„ๆจกๅž‹ๅ‚ๆ•ฐ๏ผŒๆจกๅž‹่ฎญ็ปƒ่ฟ‡็จ‹่ง https://llama.familyใ€‚

ๆจกๅž‹็š„้ƒจ็ฝฒใ€่ฎญ็ปƒใ€ๅพฎ่ฐƒ็ญ‰ๆ–นๆณ•่ฏฆ่งLlamaไธญๆ–‡็คพๅŒบGitHubไป“ๅบ“๏ผšhttps://github.com/LlamaFamily/Llama-Chinese

ๅฆ‚ไฝ•ไฝฟ็”จ

import transformers
import torch


model_id = "FlagAlpha/Llama3-Chinese-8B-Instruct"

pipeline = transformers.pipeline(
    "text-generation",
    model=model_id,
    model_kwargs={"torch_dtype": torch.float16},
    device="cuda",
)


messages = [{"role": "system", "content": ""}]

messages.append(
                {"role": "user", "content": "ไป‹็ปไธ€ไธ‹ๆœบๅ™จๅญฆไน "}
            )

prompt = pipeline.tokenizer.apply_chat_template(
        messages, 
        tokenize=False, 
        add_generation_prompt=True
    )

terminators = [
        pipeline.tokenizer.eos_token_id,
        pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
    ]
outputs = pipeline(
    prompt,
    max_new_tokens=512,
    eos_token_id=terminators,
    do_sample=True,
    temperature=0.6,
    top_p=0.9
)

content = outputs[0]["generated_text"][len(prompt):]

print(content)
Downloads last month
16,933
Safetensors
Model size
8B params
Tensor type
F16
ยท
Inference Providers NEW
Input a message to start chatting with FlagAlpha/Llama3-Chinese-8B-Instruct.

Model tree for FlagAlpha/Llama3-Chinese-8B-Instruct

Adapters
1 model
Finetunes
126 models
Merges
1 model
Quantizations
6 models

Spaces using FlagAlpha/Llama3-Chinese-8B-Instruct 10