Spaces:
Runtime error
Runtime error
Matt
commited on
Commit
•
0b3a0fe
1
Parent(s):
442c891
Let's try partial()
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer
|
3 |
import json
|
|
|
4 |
|
5 |
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceH4/zephyr-7b-beta")
|
6 |
|
@@ -146,7 +147,7 @@ with gr.Blocks() as demo:
|
|
146 |
inputs=[template_in, conversation_in, generation_prompt_check, cleanup_whitespace_check],
|
147 |
outputs=[formatted_out, code_snippet_out]
|
148 |
)
|
149 |
-
load_chatml.click(fn=load_template,
|
150 |
load_zephyr.click(fn=load_template, inputs=["zephyr"])
|
151 |
load_llama.click(fn=load_template, inputs=["llama"])
|
152 |
load_alpaca.click(fn=load_template, inputs=["alpaca"])
|
|
|
1 |
import gradio as gr
|
2 |
from transformers import AutoTokenizer
|
3 |
import json
|
4 |
+
from functools import partial
|
5 |
|
6 |
tokenizer = AutoTokenizer.from_pretrained("HuggingFaceH4/zephyr-7b-beta")
|
7 |
|
|
|
147 |
inputs=[template_in, conversation_in, generation_prompt_check, cleanup_whitespace_check],
|
148 |
outputs=[formatted_out, code_snippet_out]
|
149 |
)
|
150 |
+
load_chatml.click(fn=partial(load_template, "chatml"))
|
151 |
load_zephyr.click(fn=load_template, inputs=["zephyr"])
|
152 |
load_llama.click(fn=load_template, inputs=["llama"])
|
153 |
load_alpaca.click(fn=load_template, inputs=["alpaca"])
|