Instructions to use snoop2head/kogpt-conditional-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use snoop2head/kogpt-conditional-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="snoop2head/kogpt-conditional-2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("snoop2head/kogpt-conditional-2") model = AutoModelForCausalLM.from_pretrained("snoop2head/kogpt-conditional-2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use snoop2head/kogpt-conditional-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "snoop2head/kogpt-conditional-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "snoop2head/kogpt-conditional-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/snoop2head/kogpt-conditional-2
- SGLang
How to use snoop2head/kogpt-conditional-2 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "snoop2head/kogpt-conditional-2" \ --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": "snoop2head/kogpt-conditional-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
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 "snoop2head/kogpt-conditional-2" \ --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": "snoop2head/kogpt-conditional-2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use snoop2head/kogpt-conditional-2 with Docker Model Runner:
docker model run hf.co/snoop2head/kogpt-conditional-2
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("snoop2head/kogpt-conditional-2")
model = AutoModelForCausalLM.from_pretrained("snoop2head/kogpt-conditional-2")Quick Links
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
KoGPT-Conditional-2
Condition format
# create condition sentence
random_main_logit = np.random.normal(
loc=3.368,
scale=1.015,
size=1
)[0].round(1)
random_sub_logit = np.random.normal(
loc=1.333,
scale=0.790,
size=1
)[0].round(1)
condition_sentence = f"{random_main_logit}λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. {random_sub_logit}λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. "
Input Format
# make input sentence
input_sentence = "μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ"
condition_plus_input = condition_sentence + input_sentence
print(condition_plus_input)
3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ
How to infer
inferred_sentence = infer_sentence(condition_plus_input, k=10, output_token_length=max_token_length)
inferred_sentence
['3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μμν μ μ μ μ μ°¨λ¦¬κ³ μΌμ΄λ μ μμλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ λ¬ λ³΄λ κ±Έ μ’μνκ² λμλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μμν μ¬λλ€μ μ
μ λ€μ¬λ€ λ³Ό μ μμλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μ΄μν λλΌμ μ¨λ¦¬μ€κ° λμ΄ μμλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ κΈ°μ΄ν κ²½νμ νλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μ΄μνκ²λ ννκ° μ°Ύμμ¨λ€λ μ¬μ€μ κΉ¨λ¬μλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μ΄λ μ λ«λ 무μΈκ°κ° μλ€λ κ±Έ μμλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ λ¬λΉμ μλ―Έλ₯Ό μ΄ν΄νκΈ° μμνλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μλ°©μμ μ λ λ΄ μμ κΌ μ‘μλ€',
'3.9λ§νΌ ν볡κ°μ μΈ λ¬Έμ₯μ΄λ€. 1.2λ§νΌ λλκ°μ μΈ λ¬Έμ₯μ΄λ€. μμν λ°€λ€μ΄ κ³μλλ λ , μΈμ κ°λΆν° λλ μ΄μν λλΌμ μ¨λ¦¬μ€μ²λΌ λμ λ°μ§μ΄λ©° μ£Όμλ₯Ό νꡬνκΈ° μμνλ€']
- Downloads last month
- 5
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="snoop2head/kogpt-conditional-2")