afrizalha commited on
Commit
1940b48
·
verified ·
1 Parent(s): 539debe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -19,7 +19,7 @@ def generate(starting_text, choice, num_runs,temp,top_p):
19
  return desc
20
 
21
  results = []
22
- for i in range(num_runs):
23
  inputs = tokenizer([starting_text], return_tensors="pt").to(model.device)
24
  outputs = model.generate(
25
  inputs=inputs.input_ids,
@@ -35,14 +35,14 @@ def generate(starting_text, choice, num_runs,temp,top_p):
35
 
36
  with gr.Blocks(theme=gr.themes.Soft()) as app:
37
  starting_text = gr.Textbox(label="Starting text", value="cinta adalah")
38
- choice = gr.Radio(["7M", "25M"], label="Model size", info="Built with the Phi-3 architecture")
39
- num_runs = gr.Slider(label="Number of examples", minimum=1, maximum=10, step=1, value=5)
40
  temp = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, step=0.1, value=0.7)
41
  top_p = gr.Slider(label="Top P", minimum=0.1, maximum=1.0, step=0.1, value=0.5)
42
  res = gr.Textbox(label="Continuation")
43
  gr.Interface(
44
  fn=generate,
45
- inputs=[starting_text,choice,num_runs,temp,top_p],
46
  outputs=[res],
47
  allow_flagging="never",
48
  title="Sasando-1",
 
19
  return desc
20
 
21
  results = []
22
+ for i in range(5):
23
  inputs = tokenizer([starting_text], return_tensors="pt").to(model.device)
24
  outputs = model.generate(
25
  inputs=inputs.input_ids,
 
35
 
36
  with gr.Blocks(theme=gr.themes.Soft()) as app:
37
  starting_text = gr.Textbox(label="Starting text", value="cinta adalah")
38
+ choice = gr.Radio(["7M", "25M", "Info"], label="Select model", info="Built with the Phi-3 architecture")
39
+ # num_runs = gr.Slider(label="Number of examples", minimum=1, maximum=10, step=1, value=5)
40
  temp = gr.Slider(label="Temperature", minimum=0.1, maximum=1.0, step=0.1, value=0.7)
41
  top_p = gr.Slider(label="Top P", minimum=0.1, maximum=1.0, step=0.1, value=0.5)
42
  res = gr.Textbox(label="Continuation")
43
  gr.Interface(
44
  fn=generate,
45
+ inputs=[starting_text,choice,temp,top_p],
46
  outputs=[res],
47
  allow_flagging="never",
48
  title="Sasando-1",