legacy-datasets/wikipedia
Updated • 122k • 632
How to use yellowback/gpt-neo-japanese-1.3B with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="yellowback/gpt-neo-japanese-1.3B") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("yellowback/gpt-neo-japanese-1.3B")
model = AutoModelForCausalLM.from_pretrained("yellowback/gpt-neo-japanese-1.3B")How to use yellowback/gpt-neo-japanese-1.3B with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "yellowback/gpt-neo-japanese-1.3B"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yellowback/gpt-neo-japanese-1.3B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/yellowback/gpt-neo-japanese-1.3B
How to use yellowback/gpt-neo-japanese-1.3B with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "yellowback/gpt-neo-japanese-1.3B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yellowback/gpt-neo-japanese-1.3B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "yellowback/gpt-neo-japanese-1.3B" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "yellowback/gpt-neo-japanese-1.3B",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use yellowback/gpt-neo-japanese-1.3B with Docker Model Runner:
docker model run hf.co/yellowback/gpt-neo-japanese-1.3B
GPT2/GPT3 like model trained on Japanese.corpus.
from transformers import pipeline
>>> generator = pipeline('text-generation', model='yellowback/gpt-neo-japanese-1.3B')
>>> generator("こんばんは、徳川家康です。", do_sample=True, max_length=50, num_return_sequences=3)
[{'generated_text': 'こんばんは、徳川家康です。 世の中を見渡してみても、残念なことだけれども、まぎれもなく「世のなか...\n5月になりました、家康です。 ゴールデンウィークも終ってしまい、世間では'},
{'generated_text': 'こんばんは、徳川家康です。さあ今日は昨晩から降り続いた雨は上がりましたが、まだまだ雨脚は強いですが、晴れるところは晴れて欲しいですね。昨日の夜は仕事だったので、今日の夕'},
{'generated_text': 'こんばんは、徳川家康です。 今回は、『世界史再考──日本史再考』という本を書いたあと、『世界史再考──日本史再考』の6~8章'}]