curelycue commited on
Commit
b6b3a04
1 Parent(s): d9d73fb

Fix Gradio components for updated version

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -21,14 +21,15 @@ def generate_text(prompt, max_length=50, temperature=0.7):
21
  text = tokenizer.decode(outputs[0], skip_special_tokens=True)
22
  return text
23
 
 
24
  iface = gr.Interface(
25
  fn=generate_text,
26
  inputs=[
27
- gr.inputs.Textbox(lines=2, placeholder="Enter your prompt here..."),
28
- gr.inputs.Slider(10, 200, step=10, default=50, label="Max Length"),
29
- gr.inputs.Slider(0.1, 1.0, step=0.1, default=0.7, label="Temperature")
30
  ],
31
- outputs="text",
32
  title="Mistral 7B Nouns Model",
33
  description="Generate text using the fine-tuned Mistral 7B model."
34
  )
 
21
  text = tokenizer.decode(outputs[0], skip_special_tokens=True)
22
  return text
23
 
24
+ # Update to the new gradio components syntax
25
  iface = gr.Interface(
26
  fn=generate_text,
27
  inputs=[
28
+ gr.Textbox(lines=2, placeholder="Enter your prompt here...", label="Prompt"),
29
+ gr.Slider(10, 200, step=10, value=50, label="Max Length"),
30
+ gr.Slider(0.1, 1.0, step=0.1, value=0.7, label="Temperature")
31
  ],
32
+ outputs=gr.Textbox(label="Generated Text"),
33
  title="Mistral 7B Nouns Model",
34
  description="Generate text using the fine-tuned Mistral 7B model."
35
  )