Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,21 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
-
gr.load("models/jeevana/EmailSubjectLineGeneration").launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
import torch
|
| 3 |
+
from transformers import pipeline
|
| 4 |
+
|
| 5 |
+
#pipeline = pipeline(task="text-generation", model="EmailSubjectLineGeneration")
|
| 6 |
+
pipeline = pipeline(model="jeevana/EmailSubjectLineGeneration")
|
| 7 |
+
|
| 8 |
+
def predict(input):
|
| 9 |
+
print("pipeline object", pipeline)
|
| 10 |
+
prediction = pipeline(input)
|
| 11 |
+
print("type of response:", type(input))
|
| 12 |
+
return prediction
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
app = gr.Interface(fn=predict, inputs=[gr.Textbox(label="Email", lines=12)],
|
| 16 |
+
outputs=[gr.Textbox(label="Subject", lines=3)],
|
| 17 |
+
title="EmailSubjectLineGeneration",
|
| 18 |
+
description="EmailSubjectLineGeneration"
|
| 19 |
+
)
|
| 20 |
+
app.launch(share=True, debug=True)
|
| 21 |
|
|
|