my-AI-api / app.py
TKgumi's picture
Update app.py
bdec963 verified
raw
history blame
457 Bytes
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
MODEL_NAME = "Lightblue/DeepSeek-R1-Distill-Qwen-7B-Japanese"
tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)
generator = pipeline("text-generation", model=model, tokenizer=tokenizer)
prompt = "γ“γ‚“γ«γ‘γ―γ€γ“γ‚Œγ―γƒ†γ‚Ήγƒˆγ§γ™γ€‚"
result = generator(prompt, max_length=100)[0]['generated_text']
print(result)