radinplaid commited on
Commit
9ffdab1
·
verified ·
1 Parent(s): 3d12515

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -17
app.py CHANGED
@@ -64,21 +64,6 @@ app_ui = ui.page_navbar(
64
  ),
65
  "Balances speed and quality. 1 for fastest speed, 8 for highest quality, in between for a balance.",
66
  ),
67
- ui.tooltip(
68
- ui.input_numeric(
69
- "num_threads", "CPU Threads", min=1, max=16, step=1, value=4
70
- ),
71
- "Number of CPU threads to use for translation. Does not affect speed when using GPU.",
72
- ),
73
- ui.tooltip(
74
- ui.input_selectize(
75
- "compute_device",
76
- "Compute Device",
77
- choices=["auto", "cpu", "cuda"],
78
- selected="cpu",
79
- ),
80
- "Auto will use the GPU if available, otherwise will use CPU.",
81
- ),
82
  width="350px",
83
  ),
84
  title=ui.h2("QuickMT"),
@@ -114,8 +99,8 @@ def server(input, output, session):
114
  print(f"Loading model {input.model()}")
115
  t = Translator(
116
  str(model_path),
117
- device=input.compute_device(),
118
- inter_threads=int(input.num_threads()),
119
  )
120
  if len(input.input_text()) == 0:
121
  return ""
 
64
  ),
65
  "Balances speed and quality. 1 for fastest speed, 8 for highest quality, in between for a balance.",
66
  ),
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  width="350px",
68
  ),
69
  title=ui.h2("QuickMT"),
 
99
  print(f"Loading model {input.model()}")
100
  t = Translator(
101
  str(model_path),
102
+ device="cpu",
103
+ inter_threads=2,
104
  )
105
  if len(input.input_text()) == 0:
106
  return ""