AfkaraLP commited on
Commit
1e7d11c
·
1 Parent(s): 173decb

gradio 6 fixes: Code language=None (rust unsupported), move theme to launch()

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -158,7 +158,7 @@ def complete(code, temperature, max_tokens, top_p):
158
  return text, assembled, stats
159
 
160
 
161
- with gr.Blocks(title="RustLean FIM Playground", theme=gr.themes.Soft()) as demo:
162
  gr.Markdown(
163
  "# 🦀 RustLean — Rust FIM Completion\n"
164
  "Fill-in-the-middle completion from "
@@ -171,7 +171,7 @@ with gr.Blocks(title="RustLean FIM Playground", theme=gr.themes.Soft()) as demo:
171
  with gr.Column(scale=1):
172
  code_in = gr.Code(
173
  value=DEFAULT_CODE,
174
- language="rust",
175
  label="Rust source (mark the hole with <|cursor|>)",
176
  interactive=True,
177
  )
@@ -186,12 +186,12 @@ with gr.Blocks(title="RustLean FIM Playground", theme=gr.themes.Soft()) as demo:
186
  stats = gr.Markdown("_Not run yet._")
187
  completion = gr.Code(
188
  label="Generated middle",
189
- language="rust",
190
  interactive=False,
191
  )
192
  result = gr.Code(
193
  label="Assembled result (prefix + middle + suffix)",
194
- language="rust",
195
  interactive=True,
196
  )
197
 
@@ -206,4 +206,4 @@ with gr.Blocks(title="RustLean FIM Playground", theme=gr.themes.Soft()) as demo:
206
  outputs=[code_in, completion, result, stats])
207
 
208
  if __name__ == "__main__":
209
- demo.queue().launch()
 
158
  return text, assembled, stats
159
 
160
 
161
+ with gr.Blocks(title="RustLean FIM Playground") as demo:
162
  gr.Markdown(
163
  "# 🦀 RustLean — Rust FIM Completion\n"
164
  "Fill-in-the-middle completion from "
 
171
  with gr.Column(scale=1):
172
  code_in = gr.Code(
173
  value=DEFAULT_CODE,
174
+ language=None,
175
  label="Rust source (mark the hole with <|cursor|>)",
176
  interactive=True,
177
  )
 
186
  stats = gr.Markdown("_Not run yet._")
187
  completion = gr.Code(
188
  label="Generated middle",
189
+ language=None,
190
  interactive=False,
191
  )
192
  result = gr.Code(
193
  label="Assembled result (prefix + middle + suffix)",
194
+ language=None,
195
  interactive=True,
196
  )
197
 
 
206
  outputs=[code_in, completion, result, stats])
207
 
208
  if __name__ == "__main__":
209
+ demo.queue().launch(theme=gr.themes.Soft())