Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,13 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
|
| 7 |
-
|
|
|
|
| 8 |
|
|
|
|
|
|
|
| 9 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from transformers import pipeline
|
| 3 |
|
| 4 |
+
# Load model
|
| 5 |
+
model_name = "Genius-Society/insecta"
|
| 6 |
+
insecta_pipeline = pipeline("text-generation", model=model_name)
|
| 7 |
|
| 8 |
+
def generate_response(prompt):
|
| 9 |
+
return insecta_pipeline(prompt, max_length=100)[0]['generated_text']
|
| 10 |
|
| 11 |
+
# Gradio interface
|
| 12 |
+
iface = gr.Interface(fn=generate_response, inputs="text", outputs="text")
|
| 13 |
iface.launch()
|