orgoflu commited on
Commit
574b3b3
ยท
verified ยท
1 Parent(s): a73e7cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -12,14 +12,14 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
12
  # ===== ๋ชจ๋ธ ๋ชฉ๋ก =====
13
  MODEL_OPTIONS = {
14
  "Qwen2.5-1.5B-Instruct": "Qwen/Qwen2.5-1.5B-Instruct",
15
- "CLOVA-Text(๋Œ€์ฒด)": "kakaobrain/kogpt"
16
  }
17
 
18
  # ===== ํ…์ŠคํŠธ ๋ชจ๋ธ ๋กœ๋“œ =====
19
  def load_text_model(model_choice):
20
  model_name = MODEL_OPTIONS[model_choice]
21
- tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
22
- model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True).to("cpu")
23
  return pipeline("text-generation", model=model, tokenizer=tokenizer, device=-1)
24
 
25
  # ===== ํ…์ŠคํŠธ ์ „์ฒ˜๋ฆฌ =====
@@ -95,7 +95,7 @@ iface = gr.Interface(
95
  gr.Textbox(label="์ž๋™ ์žฌ์ž‘์„ฑ (LLM)", lines=5)
96
  ],
97
  title="ํ•œ๊ตญ์–ด ๋ณธ๋ฌธ ์ถ”์ถœ + ์ž๋™ ์š”์•ฝ + LLM ์žฌ์ž‘์„ฑ",
98
- description="์›๋ฌธ ํ…์ŠคํŠธ์—์„œ ๋ฐ”๋กœ ์š”์•ฝ ํ›„, ์„ ํƒํ•œ ๋ชจ๋ธ(Qwen ๋˜๋Š” KoGPT)๋กœ ์žฌ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค."
99
  )
100
 
101
  if __name__ == "__main__":
 
12
  # ===== ๋ชจ๋ธ ๋ชฉ๋ก =====
13
  MODEL_OPTIONS = {
14
  "Qwen2.5-1.5B-Instruct": "Qwen/Qwen2.5-1.5B-Instruct",
15
+ "CLOVA-Text(๋Œ€์ฒด)": "skt/kogpt2-base-v2"
16
  }
17
 
18
  # ===== ํ…์ŠคํŠธ ๋ชจ๋ธ ๋กœ๋“œ =====
19
  def load_text_model(model_choice):
20
  model_name = MODEL_OPTIONS[model_choice]
21
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
22
+ model = AutoModelForCausalLM.from_pretrained(model_name).to("cpu")
23
  return pipeline("text-generation", model=model, tokenizer=tokenizer, device=-1)
24
 
25
  # ===== ํ…์ŠคํŠธ ์ „์ฒ˜๋ฆฌ =====
 
95
  gr.Textbox(label="์ž๋™ ์žฌ์ž‘์„ฑ (LLM)", lines=5)
96
  ],
97
  title="ํ•œ๊ตญ์–ด ๋ณธ๋ฌธ ์ถ”์ถœ + ์ž๋™ ์š”์•ฝ + LLM ์žฌ์ž‘์„ฑ",
98
+ description="์›๋ฌธ ํ…์ŠคํŠธ์—์„œ ๋ฐ”๋กœ ์š”์•ฝ ํ›„, ์„ ํƒํ•œ ๋ชจ๋ธ(Qwen ๋˜๋Š” KoGPT2)๋กœ ์žฌ์ž‘์„ฑํ•ฉ๋‹ˆ๋‹ค."
99
  )
100
 
101
  if __name__ == "__main__":