Update app.py
Browse files
app.py
CHANGED
|
@@ -1,16 +1,12 @@
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
|
| 6 |
|
| 7 |
-
#
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
# 모델 로드 (PyTorch 사용)
|
| 11 |
-
gpt_model = pipeline("text-generation", model="gpt2", framework="pt")
|
| 12 |
-
|
| 13 |
-
# 버튼 클릭 시 결과 출력
|
| 14 |
if st.button("Generate"):
|
| 15 |
-
|
| 16 |
-
st.write(
|
|
|
|
| 1 |
import streamlit as st
|
| 2 |
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# 모델 로드
|
| 5 |
+
model = pipeline("text-generation", model="EleutherAI/gpt-neo-2.7B")
|
| 6 |
|
| 7 |
+
# 웹 인터페이스 생성
|
| 8 |
+
st.title("GPT-N Model")
|
| 9 |
+
input_text = st.text_input("Enter your prompt:")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
if st.button("Generate"):
|
| 11 |
+
result = model(input_text)
|
| 12 |
+
st.write(result[0]["generated_text"])
|