jason9693's picture
fixed import error
abdf1a8
raw
history blame
1.08 kB
import gradio as gr
from transformers import pipeline
import os
theme = "darkgrass"
title = "GPT-NeoX(Korean) Demo"
model_name = "EleutherAI/gpt-neox-ko-1.3b"
description = "GPT-NeoX ν•œκ΅­μ–΄ λͺ¨λΈμ„ μ‹œμ—°ν•˜λŠ” 데λͺ¨νŽ˜μ΄μ§€ μž…λ‹ˆλ‹€."
# article = "<p style='text-align: center'><a href='https://github.com/kingoflolz/mesh-transformer-jax' target='_blank'>GPT-J-6B: A 6 Billion Parameter Autoregressive Language Model</a></p>"
examples = [
["μΈκ°„μ²˜λŸΌ μƒκ°ν•˜κ³ , ν–‰λ™ν•˜λŠ” '지λŠ₯'을 톡해"],
["λŒ€ν•œλ―Όκ΅­μ˜ 2040λ…„ 전망은 "],
["2040λ…„ 미ꡭ은, "]
]
generator = pipeline('text-generation', model=model_name, use_auth_token=os.environ['TOKEN'])
gr.Interface.from_pipeline(generator).launch()
# print(generated) # print: μΈκ°„μ²˜λŸΌ μƒκ°ν•˜κ³ , ν–‰λ™ν•˜λŠ” '지λŠ₯'을 톡해 인λ₯˜κ°€ μ΄μ œκΉŒμ§€ 풀지 λͺ»ν–ˆλ˜ 문제의 해닡을 찾을 수 μžˆμ„ 것이닀. κ³Όν•™κΈ°μˆ μ΄ κ³ λ„λ‘œ λ°œλ‹¬ν•œ 21μ„ΈκΈ°λ₯Ό μ‚΄μ•„κ°ˆ 우리 μ•„μ΄λ“€μ—κ²Œ κ°€μž₯ ν•„μš”ν•œ 것은 사고λ ₯ ν›ˆλ ¨μ΄λ‹€. 사고λ ₯ ν›ˆλ ¨μ„ 톡해, 세상