benchang1110 / Taiwan-tinyllama-v1.0-base

huggingface.co
Total runs: 21
24-hour runs: 0
7-day runs: 4
30-day runs: 5
Model's Last Updated: May 20 2024
text-generation

Introduction of Taiwan-tinyllama-v1.0-base

Model Details of Taiwan-tinyllama-v1.0-base

Model Card for Model ID

This is a continue-pretrained version of Tinyllama tailored for traditional Chinese. The continue-pretraining dataset contains roughly 2B tokens.

Usage

from transformers import AutoModelForCausalLM, AutoTokenizer
import torch

def generate_response(input):
    '''
    simple test for the model
    '''
    # tokenzize the input
    tokenized_input = tokenizer.encode_plus(input, return_tensors='pt').to(device)
    
    # generate the response
    outputs = model.generate(
        input_ids=tokenized_input['input_ids'], 
        attention_mask=tokenized_input['attention_mask'],
        pad_token_id=tokenizer.pad_token_id,
        do_sample=False,
        repetition_penalty=1.3,
        max_length=500
    )
    
    # decode the response
    return tokenizer.decode(outputs[0], skip_special_tokens=True)

if __name__ == '__main__':
    device = 'cuda' if torch.cuda.is_available() else 'cpu'
    model = AutoModelForCausalLM.from_pretrained("benchang1110/Taiwan-tinyllama-v1.0-base",device_map=device,torch_dtype=torch.bfloat16)
    tokenizer = AutoTokenizer.from_pretrained("benchang1110/Taiwan-tinyllama-v1.0-base")
    while(True):
        text = input("input a simple prompt:")
        print('System:', generate_response(text))

Using bfloat16, the VRAM required is around 3GB!!!

Runs of benchang1110 Taiwan-tinyllama-v1.0-base on huggingface.co

21
Total runs
0
24-hour runs
6
3-day runs
4
7-day runs
5
30-day runs

More Information About Taiwan-tinyllama-v1.0-base huggingface.co Model

More Taiwan-tinyllama-v1.0-base license Visit here:

https://choosealicense.com/licenses/apache-2.0

Taiwan-tinyllama-v1.0-base huggingface.co

Taiwan-tinyllama-v1.0-base huggingface.co is an AI model on huggingface.co that provides Taiwan-tinyllama-v1.0-base's model effect (), which can be used instantly with this benchang1110 Taiwan-tinyllama-v1.0-base model. huggingface.co supports a free trial of the Taiwan-tinyllama-v1.0-base model, and also provides paid use of the Taiwan-tinyllama-v1.0-base. Support call Taiwan-tinyllama-v1.0-base model through api, including Node.js, Python, http.

Taiwan-tinyllama-v1.0-base huggingface.co Url

https://huggingface.co/benchang1110/Taiwan-tinyllama-v1.0-base

benchang1110 Taiwan-tinyllama-v1.0-base online free

Taiwan-tinyllama-v1.0-base huggingface.co is an online trial and call api platform, which integrates Taiwan-tinyllama-v1.0-base's modeling effects, including api services, and provides a free online trial of Taiwan-tinyllama-v1.0-base, you can try Taiwan-tinyllama-v1.0-base online for free by clicking the link below.

benchang1110 Taiwan-tinyllama-v1.0-base online free url in huggingface.co:

https://huggingface.co/benchang1110/Taiwan-tinyllama-v1.0-base

Taiwan-tinyllama-v1.0-base install

Taiwan-tinyllama-v1.0-base is an open source model from GitHub that offers a free installation service, and any user can find Taiwan-tinyllama-v1.0-base on GitHub to install. At the same time, huggingface.co provides the effect of Taiwan-tinyllama-v1.0-base install, users can directly use Taiwan-tinyllama-v1.0-base installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

Taiwan-tinyllama-v1.0-base install url in huggingface.co:

https://huggingface.co/benchang1110/Taiwan-tinyllama-v1.0-base

Url of Taiwan-tinyllama-v1.0-base

Taiwan-tinyllama-v1.0-base huggingface.co Url

Provider of Taiwan-tinyllama-v1.0-base huggingface.co

benchang1110
ORGANIZATIONS

Other API from benchang1110

huggingface.co

Total runs: 13
Run Growth: 0
Growth Rate: 0.00%
Updated:November 13 2023
huggingface.co

Total runs: 11
Run Growth: 0
Growth Rate: 0.00%
Updated:February 24 2024