Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,21 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello
|
5 |
|
6 |
model_choices = ["gpt2", "bert-base-uncased", "llama3-8b"]
|
7 |
|
8 |
-
|
9 |
with gr.Blocks() as demo:
|
10 |
gr.Markdown("# Instruction Tuning with Unsloth")
|
11 |
model_name = gr.Dropdown(label="Model", choices=model_choices, value="gpt2")
|
12 |
-
gr.
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
def greet(model_name, prompt_template, name):
|
4 |
+
return f"Hello {name}!! Using model: {model_name} with template: {prompt_template}"
|
5 |
|
6 |
model_choices = ["gpt2", "bert-base-uncased", "llama3-8b"]
|
7 |
|
|
|
8 |
with gr.Blocks() as demo:
|
9 |
gr.Markdown("# Instruction Tuning with Unsloth")
|
10 |
model_name = gr.Dropdown(label="Model", choices=model_choices, value="gpt2")
|
11 |
+
prompt_template = gr.Textbox(label="Prompt Template", value="Instruction: {0}\nOutput: {1}")
|
12 |
+
name_input = gr.Textbox(label="Your Name")
|
13 |
+
|
14 |
+
greet_btn = gr.Button("Greet")
|
15 |
+
output = gr.Textbox(label="Output")
|
16 |
+
|
17 |
+
greet_btn.click(fn=greet,
|
18 |
+
inputs=[model_name, prompt_template, name_input],
|
19 |
+
outputs=output)
|
20 |
|
21 |
+
demo.launch()
|