daeguhighschool commited on
Commit
7529a43
·
verified ·
1 Parent(s): 452c4ac

requirements.txt

Browse files

transformers
torch
gradio

Files changed (1) hide show
  1. app.py +15 -0
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ importgradio as gr
2
+ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
3
+
4
+ model_id = "daeguhighschool/my-student-chatbot-v2" # 너의 모델 경로
5
+
6
+ tokenizer = AutoTokenizer.from_pretrained(model_id)
7
+ model = AutoModelForCausalLM.from_pretrained(model_id)
8
+
9
+ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
10
+
11
+ def chat(prompt):
12
+ result = pipe(prompt, max_new_tokens=100)[0]["generated_text"]
13
+ return result
14
+
15
+ gr.Interface(fn=chat, inputs="text", outputs="text", title="학생용 LLM 챗봇").launch()