tykiww commited on
Commit
bd3b81a
1 Parent(s): 5d52f32

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -1,16 +1,21 @@
1
  import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
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.Interface(fn=greet,
13
- inputs="text",
14
- outputs="text")
 
 
 
 
 
 
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()