fantaxy commited on
Commit
f3ce154
·
verified ·
1 Parent(s): 7c254b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -52,8 +52,8 @@ def load_gallery_images():
52
  return [(os.path.join("gallery", row[2]), f"{row[0]}: {row[1]}") for row in rows]
53
 
54
  # CPU에서 실행되는 번역기 초기화
55
- translator = pipeline("translation", model="Helsinki-NLP/opus-mt-ko-en", device=-1)
56
 
 
57
  # 프롬프트 처리 함수
58
  def process_prompt(prompt):
59
  if any('\u3131' <= char <= '\u3163' or '\uac00' <= char <= '\ud7a3' for char in prompt):
 
52
  return [(os.path.join("gallery", row[2]), f"{row[0]}: {row[1]}") for row in rows]
53
 
54
  # CPU에서 실행되는 번역기 초기화
 
55
 
56
+ translator = pipeline("translation", model="Helsinki-NLP/opus-mt-ko-en", device=torch.device('cpu'), from_tf=True)
57
  # 프롬프트 처리 함수
58
  def process_prompt(prompt):
59
  if any('\u3131' <= char <= '\u3163' or '\uac00' <= char <= '\ud7a3' for char in prompt):