Spaces:
Sleeping
Sleeping
curelycue
commited on
Commit
•
b6b3a04
1
Parent(s):
d9d73fb
Fix Gradio components for updated version
Browse files
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.
|
28 |
-
gr.
|
29 |
-
gr.
|
30 |
],
|
31 |
-
outputs="
|
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 |
)
|