gradio 6 fixes: Code language=None (rust unsupported), move theme to launch()
Browse files
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"
|
| 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=
|
| 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=
|
| 190 |
interactive=False,
|
| 191 |
)
|
| 192 |
result = gr.Code(
|
| 193 |
label="Assembled result (prefix + middle + suffix)",
|
| 194 |
-
language=
|
| 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())
|