Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import gradio as gr
|
|
| 4 |
from transformers import Tool
|
| 5 |
from huggingface_hub import upload_folder
|
| 6 |
from huggingface_hub import create_repo
|
| 7 |
-
from gradio import forms
|
| 8 |
|
| 9 |
|
| 10 |
def generate_files(title="Text Generation Tool", tool_description="This is a tool that chats with a user. "
|
|
@@ -104,10 +104,14 @@ class {}(Tool):
|
|
| 104 |
# Return the generated files for download
|
| 105 |
return f"Chris4K/{tool_class}"
|
| 106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
|
| 108 |
# Define the inputs for the Gradio interface
|
| 109 |
io = gr.Interface(generate_files,
|
| 110 |
-
inputs=[
|
| 111 |
outputs=["text"])
|
| 112 |
|
| 113 |
# Launch the Gradio interface
|
|
|
|
| 4 |
from transformers import Tool
|
| 5 |
from huggingface_hub import upload_folder
|
| 6 |
from huggingface_hub import create_repo
|
| 7 |
+
#from gradio import forms
|
| 8 |
|
| 9 |
|
| 10 |
def generate_files(title="Text Generation Tool", tool_description="This is a tool that chats with a user. "
|
|
|
|
| 104 |
# Return the generated files for download
|
| 105 |
return f"Chris4K/{tool_class}"
|
| 106 |
|
| 107 |
+
zinputs = [
|
| 108 |
+
gr.inputs.Text(default="Text Generation Tool"),
|
| 109 |
+
gr.inputs.Text(default="It takes an input named `prompt` which contains a system_role, user_message, context and history. It returns a text message.")
|
| 110 |
+
]
|
| 111 |
|
| 112 |
# Define the inputs for the Gradio interface
|
| 113 |
io = gr.Interface(generate_files,
|
| 114 |
+
inputs=[zinputs],
|
| 115 |
outputs=["text"])
|
| 116 |
|
| 117 |
# Launch the Gradio interface
|